package stest.tron.wallet.depositWithdraw;

import com.google.protobuf.ByteString;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.spongycastle.util.encoders.Hex;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
import org.tron.api.GrpcAPI.TransactionExtention;
import org.tron.api.WalletGrpc;
import org.tron.api.WalletSolidityGrpc;
import org.tron.common.crypto.ECKey;
import org.tron.common.utils.ByteArray;
import org.tron.common.utils.Utils;
import org.tron.core.Wallet;
import org.tron.protos.Protocol.Account;
import org.tron.protos.Protocol.TransactionInfo;
import stest.tron.wallet.common.client.Configuration;
import stest.tron.wallet.common.client.Parameter.CommonConstant;
import stest.tron.wallet.common.client.WalletClient;
import stest.tron.wallet.common.client.utils.AbiUtil;
import stest.tron.wallet.common.client.utils.Base58;
import stest.tron.wallet.common.client.utils.PublicMethed;
import stest.tron.wallet.common.client.utils.PublicMethedForDailybuild;


@Slf4j
public class DelegateCallMain001 {


  private final String testDepositTrx = Configuration.getByPath("testng.conf")
      .getString("foundationAccount.key2");
  private final byte[] testDepositAddress = PublicMethed.getFinalAddress(testDepositTrx);
  private Long maxFeeLimit = Configuration.getByPath("testng.conf")
      .getLong("defaultParameter.maxFeeLimit");
  private ManagedChannel channelSolidity = null;

  private ManagedChannel channelFull = null;
  private WalletGrpc.WalletBlockingStub blockingStubFull = null;

  private ManagedChannel channelFull1 = null;
  private WalletGrpc.WalletBlockingStub blockingSideStubFull = null;


  private WalletSolidityGrpc.WalletSolidityBlockingStub blockingStubSolidity = null;
  private String fullnode = Configuration.getByPath("testng.conf")
      .getStringList("mainfullnode.ip.list").get(0);
  private String fullnode1 = Configuration.getByPath("testng.conf")
      .getStringList("fullnode.ip.list").get(0);

  ECKey ecKey1 = new ECKey(Utils.getRandom());
  byte[] depositAddress = ecKey1.getAddress();
  String testKeyFordeposit = ByteArray.toHexString(ecKey1.getPrivKeyBytes());
  final String mainGateWayAddress = Configuration.getByPath("testng.conf")
      .getString("gateway_address.key1");
  final byte[] mainGateWayAddressKey = WalletClient.decodeFromBase58Check(mainGateWayAddress);

  final String sideGatewayAddress = Configuration.getByPath("testng.conf")
      .getString("gateway_address.key2");
  final byte[] sideChainAddressKey = WalletClient.decodeFromBase58Check(sideGatewayAddress);

  final String chainIdAddress = Configuration.getByPath("testng.conf")
      .getString("gateway_address.chainIdAddress");
  final byte[] chainIdAddressKey = WalletClient.decodeFromBase58Check(chainIdAddress);

  final String gateWatOwnerAddressKey = Configuration.getByPath("testng.conf")
      .getString("gateWatOwnerAddressKey.key1");

  private final byte[] gateWatOwnerAddress = PublicMethed.getFinalAddress(gateWatOwnerAddressKey);

  private final String testOracle = Configuration.getByPath("testng.conf")
      .getString("oralceAccountKey.key1");
  private final byte[] testOracleAddress = PublicMethed.getFinalAddress(testOracle);
  String parame1 = null;
  String methodStr1 = null;

  private final String mainGateWayOwner = Configuration.getByPath("testng.conf")
      .getString("gateWatOwnerAddressKey.key1");
  private final byte[] mainGateWayOwnerAddress = PublicMethed.getFinalAddress(mainGateWayOwner);

  private final String sideGateWayOwner = Configuration.getByPath("testng.conf")
      .getString("gateWatOwnerAddressKey.key2");
  private final byte[] sideGateWayOwnerAddress = PublicMethed.getFinalAddress(sideGateWayOwner);
  final String ChainIdAddress = Configuration.getByPath("testng.conf")
      .getString("gateway_address.chainIdAddress");

  @BeforeSuite
  public void beforeSuite() {
    Wallet wallet = new Wallet();
    Wallet.setAddressPreFixByte(CommonConstant.ADD_PRE_FIX_BYTE_MAINNET);
  }

  /**
   * constructor.
   */

  @BeforeClass(enabled = true)
  public void beforeClass() {
    PublicMethed.printAddress(testKeyFordeposit);
    channelFull = ManagedChannelBuilder.forTarget(fullnode)
        .usePlaintext(true)
        .build();
    blockingStubFull = WalletGrpc.newBlockingStub(channelFull);
    channelFull1 = ManagedChannelBuilder.forTarget(fullnode1)
        .usePlaintext(true)
        .build();
    blockingSideStubFull = WalletGrpc.newBlockingStub(channelFull1);
  }

  @Test(enabled = true, description = "DelegateCall in mainChain")
  public void test1DelegateCallMain001() {

    methodStr1 = "setDepositMinTrx(uint256)";
    parame1 = "2";
    byte[] input1 = Hex.decode(AbiUtil.parseMethod(methodStr1, parame1, false));

    String txid1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            0,
            input1,
            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    logger.info("ownerTrx : " + txid1);
    Optional<TransactionInfo> infoById2 = PublicMethed
        .getTransactionInfoById(txid1, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    Assert.assertEquals(0, infoById2.get().getResultValue());

    String methodStr2 = "depositMinTrx()";
    byte[] input2 = Hex.decode(AbiUtil.parseMethod(methodStr2, "", false));

    TransactionExtention return1 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input2, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Long MinTrx = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return1.getConstantResult(0).toByteArray())));
    Assert.assertEquals(MinTrx, Long.valueOf(parame1));

    // deploy testMainContract
    String contractName = "testMainContract";
    String code = "60c0604052600560808190527f312e302e3100000000000000000000000000000000000000000000000000000060a0908152620000409160009190620000bf565b506040805180820190915260058082527f312e302e3100000000000000000000000000000000000000000000000000000060209092019182526200008791600191620000bf565b506001600e819055600f81905560108190556001600160401b03601555601655600380546001600160a01b0319163317905562000164565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200010257805160ff191683800117855562000132565b8280016001018555821562000132579182015b828111156200013257825182559160200191906001019062000115565b506200014092915062000144565b5090565b6200016191905b808211156200014057600081556001016200014b565b90565b615a2780620001746000396000f3fe60806040526004361061038c5760003560e01c80638456cb59116101dc578063cd9b9a5711610102578063dfe59245116100a0578063f73392921161006f578063f733929214610ef3578063f821484314610f06578063fd0ee85614610f40578063fdcfc3ef14610f6f5761038c565b8063dfe5924514610e0b578063e6a9650814610e45578063e7fc18f814610e7f578063f2fde38b14610eb95761038c565b8063d779039b116100dc578063d779039b14610d23578063dd012a1514610d5d578063df5dd1a514610d97578063dfd16f1914610dd15761038c565b8063cd9b9a5714610c80578063cd9df8e114610cba578063d421c49b14610ce95761038c565b806397bcfad01161017a578063a029b09611610149578063a029b09614610ba3578063a97e5c9314610bd2578063bc3d4d1614610c0c578063bedb86fb14610c465761038c565b806397bcfad014610aed57806399b0322314610b2757806399f4727a14610b615780639c1fcc4c14610b745761038c565b80638da5cb5b116101b65780638da5cb5b14610a4d578063905a032614610a7c57806392cb74b214610aab57806395a7a4a514610abe5761038c565b80638456cb59146109b557806385815ac1146109e4578063898de99914610a1e5761038c565b8063490ae210116102c157806367a527931161025f578063797a8ba31161022e578063797a8ba3146108cd5780637dc79375146109075780637f6e086014610941578063826be18e1461097b5761038c565b806367a52793146107f957806367bf59031461082857806373d9cb491461086457806375b4d78c1461089e5761038c565b80635ce692f21161029b5780635ce692f2146107275780635e0082c11461075657806363e6023014610790578063641657cb146107bf5761038c565b8063490ae210146106b65780634b398e99146106f05780635174169e146106f85761038c565b806315c785e71161032e57806338d38c971161030857806338d38c971461061a5780634171a537146106565780634638c54814610669578063473c3bd71461067c5761038c565b806315c785e7146105a95780632ce61de9146105d857806332caa118146106075761038c565b80630b2341831161036a5780630b234183146104b95780630c73e51f146105025780630fc7ad421461052257806312bec7b11461056f5761038c565b806304f06385146103fe57806307da68f51461043a5780630a61c59f1461047f575b60095462010000900460ff16156103be5760405162461bcd60e51b81526004016103b5906156e7565b60405180910390fd5b600954610100900460ff16156103e65760405162461bcd60e51b81526004016103b590615687565b60405162461bcd60e51b81526004016103b590615737565b34801561040a57600080fd5b50d3801561041757600080fd5b50d2801561042457600080fd5b50610438610433366004614503565b610fa9565b005b34801561044657600080fd5b50d3801561045357600080fd5b50d2801561046057600080fd5b50610469611113565b6040516104769190615534565b60405180910390f35b34801561048b57600080fd5b50d3801561049857600080fd5b50d280156104a557600080fd5b506104386104b4366004614412565b611122565b3480156104c557600080fd5b50d380156104d257600080fd5b50d280156104df57600080fd5b506104f36104ee366004614709565b611194565b604051610476939291906154a2565b610515610510366004614775565b61125d565b6040516104769190615837565b34801561052e57600080fd5b50d3801561053b57600080fd5b50d2801561054857600080fd5b5061055c610557366004614709565b6115fd565b60405161047697969594939291906154b0565b34801561057b57600080fd5b50d3801561058857600080fd5b50d2801561059557600080fd5b506104386105a4366004614412565b6116c6565b3480156105b557600080fd5b50d380156105c257600080fd5b50d280156105cf57600080fd5b50610515611719565b3480156105e457600080fd5b50d380156105f157600080fd5b50d280156105fe57600080fd5b5061051561171f565b6105156106153660046146a1565b611725565b34801561062657600080fd5b50d3801561063357600080fd5b50d2801561064057600080fd5b5061064961199f565b60405161047691906155b1565b610515610664366004614616565b611a2d565b610438610677366004614709565b611e02565b34801561068857600080fd5b50d3801561069557600080fd5b50d280156106a257600080fd5b506105156106b1366004614412565b6120c8565b3480156106c257600080fd5b50d380156106cf57600080fd5b50d280156106dc57600080fd5b506104386106eb366004614709565b6120da565b61051561212d565b34801561070457600080fd5b50d3801561071157600080fd5b50d2801561071e57600080fd5b506105156123f7565b34801561073357600080fd5b50d3801561074057600080fd5b50d2801561074d57600080fd5b506105156123fd565b34801561076257600080fd5b50d3801561076f57600080fd5b50d2801561077c57600080fd5b5061051561078b366004614709565b612403565b34801561079c57600080fd5b50d380156107a957600080fd5b50d280156107b657600080fd5b50610649612443565b3480156107cb57600080fd5b50d380156107d857600080fd5b50d280156107e557600080fd5b506104386107f4366004614646565b61249d565b34801561080557600080fd5b50d3801561081257600080fd5b50d2801561081f57600080fd5b5061051561259b565b34801561083457600080fd5b50d3801561084157600080fd5b50d2801561084e57600080fd5b506108576125a1565b604051610476919061530e565b34801561087057600080fd5b50d3801561087d57600080fd5b50d2801561088a57600080fd5b50610438610899366004614646565b6125b0565b3480156108aa57600080fd5b50d380156108b757600080fd5b50d280156108c457600080fd5b506105156125ed565b3480156108d957600080fd5b50d380156108e657600080fd5b50d280156108f357600080fd5b50610469610902366004614682565b6125f3565b34801561091357600080fd5b50d3801561092057600080fd5b50d2801561092d57600080fd5b5061043861093c366004614412565b61261c565b34801561094d57600080fd5b50d3801561095a57600080fd5b50d2801561096757600080fd5b506104386109763660046145a6565b6126f6565b34801561098757600080fd5b50d3801561099457600080fd5b50d280156109a157600080fd5b506108576109b0366004614709565b612890565b3480156109c157600080fd5b50d380156109ce57600080fd5b50d280156109db57600080fd5b506104696128ab565b3480156109f057600080fd5b50d380156109fd57600080fd5b50d28015610a0a57600080fd5b50610438610a193660046145a6565b6128b9565b348015610a2a57600080fd5b50d38015610a3757600080fd5b50d28015610a4457600080fd5b50610515612a5e565b348015610a5957600080fd5b50d38015610a6657600080fd5b50d28015610a7357600080fd5b50610857612a64565b348015610a8857600080fd5b50d38015610a9557600080fd5b50d28015610aa257600080fd5b50610515612a73565b610438610ab9366004614709565b612a79565b348015610aca57600080fd5b50d38015610ad757600080fd5b50d28015610ae457600080fd5b50610515612c5e565b348015610af957600080fd5b50d38015610b0657600080fd5b50d28015610b1357600080fd5b50610438610b223660046145dc565b612c64565b348015610b3357600080fd5b50d38015610b4057600080fd5b50d28015610b4d57600080fd5b50610438610b5c366004614709565b612c80565b610515610b6f3660046146a1565b612cd3565b348015610b8057600080fd5b50d38015610b8d57600080fd5b50d28015610b9a57600080fd5b50610857612f46565b348015610baf57600080fd5b50d38015610bbc57600080fd5b50d28015610bc957600080fd5b50610649612f55565b348015610bde57600080fd5b50d38015610beb57600080fd5b50d28015610bf857600080fd5b50610469610c07366004614412565b612fea565b348015610c1857600080fd5b50d38015610c2557600080fd5b50d28015610c3257600080fd5b50610438610c41366004614709565b613007565b348015610c5257600080fd5b50d38015610c5f57600080fd5b50d28015610c6c57600080fd5b50610438610c7b366004614646565b61305a565b348015610c8c57600080fd5b50d38015610c9957600080fd5b50d28015610ca657600080fd5b50610515610cb5366004614412565b6130d2565b348015610cc657600080fd5b50d38015610cd357600080fd5b50d28015610ce057600080fd5b506105156130e4565b348015610cf557600080fd5b50d38015610d0257600080fd5b50d28015610d0f57600080fd5b50610515610d1e366004614412565b6130e9565b348015610d2f57600080fd5b50d38015610d3c57600080fd5b50d28015610d4957600080fd5b50610438610d58366004614709565b6130fb565b348015610d6957600080fd5b50d38015610d7657600080fd5b50d28015610d8357600080fd5b50610438610d92366004614709565b61312a565b348015610da357600080fd5b50d38015610db057600080fd5b50d28015610dbd57600080fd5b50610438610dcc366004614412565b61315f565b348015610ddd57600080fd5b50d38015610dea57600080fd5b50d28015610df757600080fd5b50610469610e06366004614745565b6132b9565b348015610e1757600080fd5b50d38015610e2457600080fd5b50d28015610e3157600080fd5b50610438610e4036600461444e565b61334b565b348015610e5157600080fd5b50d38015610e5e57600080fd5b50d28015610e6b57600080fd5b50610438610e7a366004614709565b6134db565b348015610e8b57600080fd5b50d38015610e9857600080fd5b50d28015610ea557600080fd5b50610515610eb4366004614412565b61350a565b348015610ec557600080fd5b50d38015610ed257600080fd5b50d28015610edf57600080fd5b50610438610eee366004614412565b613589565b610515610f013660046145dc565b6135f2565b348015610f1257600080fd5b50d38015610f1f57600080fd5b50d28015610f2c57600080fd5b50610438610f3b366004614709565b613949565b348015610f4c57600080fd5b50d38015610f5957600080fd5b50d28015610f6657600080fd5b50610469613978565b348015610f7b57600080fd5b50d38015610f8857600080fd5b50d28015610f9557600080fd5b50610438610fa4366004614412565b613981565b60095462010000900460ff1615610fd25760405162461bcd60e51b81526004016103b5906156e7565b33600090815260056020526040902054610ffe5760405162461bcd60e51b81526004016103b590615697565b600454825111156110215760405162461bcd60e51b81526004016103b590615677565b60008585856040516020016110389392919061526d565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff1615611080575061110c565b600061108e828686866139c4565b90508015611109576040516001600160a01b0388169087156108fc029088906000818181858888f193505050501580156110cc573d6000803e3d6000fd5b507fee6b364f3c623639ef23c3c101adb53872193b08602d3013e6fec13e5a0a8c85878787604051611100939291906153ff565b60405180910390a15b50505b5050505050565b60095462010000900460ff1681565b6003546001600160a01b0316331461114c5760405162461bcd60e51b81526004016103b590615727565b6001600160a01b0381166111725760405162461bcd60e51b81526004016103b590615787565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b60008060006111a161414f565b601485815481106111ae57fe5b60009182526020918290206040805160608101909152910180546001600160a01b03811683529192909190830190600160a01b900460ff1660038111156111f157fe5b60038111156111fc57fe5b81528154602090910190600160a81b900460ff16600381111561121b57fe5b600381111561122657fe5b9052508051602082015191925090600381111561123f57fe5b8260400151600381111561124f57fe5b935093509350509193909250565b60008282d36001600160401b0316826001600160401b0316146112925760405162461bcd60e51b81526004016103b590615757565bd26001600160401b0316816001600160401b0316146112c35760405162461bcd60e51b81526004016103b590615607565b60095462010000900460ff16156112ec5760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff16156113145760405162461bcd60e51b81526004016103b590615687565b3332146113335760405162461bcd60e51b81526004016103b590615707565b600b543410156113555760405162461bcd60e51b81526004016103b5906156b7565b600b5434111561139157600b546040513391340380156108fc02916000818181858888f1935050505015801561138f573d6000803e3d6000fd5b505b600b54600d80549091019055600f54d210156113bf5760405162461bcd60e51b81526004016103b590615827565b601554d311156113e15760405162461bcd60e51b81526004016103b5906156f7565b601554d211156114035760405162461bcd60e51b81526004016103b590615647565b60136040518060e00160405280336001600160a01b03168152602001866001600160401b03168152602001600163ffffffff16815260200160006001600160a01b03168152602001876001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b3386866001601380549050036040516115e39493929190615435565b60405180910390a16013546000190192505b505092915050565b6000806000806000806000611610614170565b6013898154811061161d57fe5b60009182526020918290206040805160e08101825260039390930290910180546001600160a01b038082168086526001600160401b03600160a01b808504821698880189905263ffffffff600160e01b958690048116978901889052600187015494851660608a0181905291850490921660808901819052949093041660a0870181905260029094015460c09096018690529f959e50929c50919a509098509650945092505050565b6001600160a01b038116600090815260176020526040908190205490517f868ad677590bc2791bdee23c70e0ca2506c208db96d6973637b0a1e46182d8929161170e91615837565b60405180910390a150565b600a5481565b60105481565b60095460009062010000900460ff16156117515760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff16156117795760405162461bcd60e51b81526004016103b590615687565b3332146117985760405162461bcd60e51b81526004016103b590615707565b600a543410156117ba5760405162461bcd60e51b81526004016103b590615817565b600a543411156117f657600a546040513391340380156108fc02916000818181858888f193505050501580156117f4573d6000803e3d6000fd5b505b600a54600d80549091019055600061180e8333613c1c565b6011549091506001600160a01b038083169116141561183f5760405162461bcd60e51b81526004016103b590615807565b6001600160a01b038116600090815260126020526040902054600114156118785760405162461bcd60e51b81526004016103b5906156a7565b803b8061188457600080fd5b60408051606081019091526001600160a01b038316815260149060208101600381526020016000905281546001810180845560009384526020938490208351920180546001600160a01b0319166001600160a01b0390931692909217808355938301519093829060ff60a01b1916600160a01b83600381111561190357fe5b021790555060408201518154829060ff60a81b1916600160a81b83600381111561192957fe5b02179055505050506001600160a01b038216600090815260126020526040908190206001905560145490517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a60380868916119869185916000190190615487565b60405180910390a150506014546000190190505b919050565b6000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015611a255780601f106119fa57610100808354040283529160200191611a25565b820191906000526020600020905b815481529060010190602001808311611a0857829003601f168201915b505050505081565b60095460009062010000900460ff1615611a595760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff1615611a815760405162461bcd60e51b81526004016103b590615687565b333214611aa05760405162461bcd60e51b81526004016103b590615707565b6001600160a01b038316600090815260126020526040902054600114611ad85760405162461bcd60e51b81526004016103b590615627565b601054826001600160401b03161015611b035760405162461bcd60e51b81526004016103b5906155f7565b600b54341015611b255760405162461bcd60e51b81526004016103b5906156b7565b600b54341115611b6157600b546040513391340380156108fc02916000818181858888f19350505050158015611b5f573d6000803e3d6000fd5b505b600b54600d805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd90611b9d90339030908790600401615344565b602060405180830381600087803b158015611bb757600080fd5b505af1158015611bcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bef9190810190614664565b611c0b5760405162461bcd60e51b81526004016103b5906157f7565b60136040518060e00160405280336001600160a01b03168152602001846001600160401b03168152602001600263ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc7338484600160138054905003604051611deb94939291906153bc565b60405180910390a150601354600019015b92915050565b60095462010000900460ff1615611e2b5760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff1615611e535760405162461bcd60e51b81526004016103b590615687565b333214611e725760405162461bcd60e51b81526004016103b590615707565b600c54341015611e945760405162461bcd60e51b81526004016103b5906157a7565b600c54341115611ed057600c546040513391340380156108fc02916000818181858888f19350505050158015611ece573d6000803e3d6000fd5b505b600c54600d805490910190556013548110611efd5760405162461bcd60e51b81526004016103b5906157c7565b600060138281548110611f0c57fe5b600091825260209091206003909102018054909150600160e01b900463ffffffff16611f8d5780546040517f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff91611f80916001600160a01b03821691600160a01b90046001600160401b0316908690615518565b60405180910390a16120c4565b8054600160e01b900463ffffffff1660021415611ffb57805460018201546040517f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc792611f80926001600160a01b0380831693911691600160a01b90046001600160401b0316908790615479565b8054600160e01b900463ffffffff166003141561205d578054600182015460028301546040517fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a93611f80936001600160a01b0391821693911691879061546b565b805460018201546040517fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b926120bb926001600160a01b038216926001600160401b03600160a01b9283900481169392909204909116908790615526565b60405180910390a15b5050565b60126020526000908152604090205481565b6003546001600160a01b031633146121045760405162461bcd60e51b81526004016103b590615727565b6305f5e1008111156121285760405162461bcd60e51b81526004016103b5906157e7565b600b55565b60095460009062010000900460ff16156121595760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff16156121815760405162461bcd60e51b81526004016103b590615687565b3332146121a05760405162461bcd60e51b81526004016103b590615707565b600b543410156121c25760405162461bcd60e51b81526004016103b5906156b7565b600b54600d805482019055600e5434919091039081108015906121e757506015548111155b6122035760405162461bcd60e51b81526004016103b5906156c7565b60136040518060e00160405280336001600160a01b03168152602001836001600160401b03168152602001600063ffffffff16815260200160006001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff33826001601380549050036040516123e29392919061541a565b60405180910390a15050601354600019015b90565b600c5481565b60165481565b600030828015801561241457600080fd5b50806001603f1b1115801561242857600080fd5b5080620f42401015801561243b57600080fd5b50d192915050565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015611a255780601f106119fa57610100808354040283529160200191611a25565b6002546001600160a01b031615612558576002546040516000916060916001600160a01b03909116906124d390849036906152d0565b600060405180830381855af49150503d806000811461250e576040519150601f19603f3d011682016040523d82523d6000602084013e612513565b606091505b50915091507f8d47f8674d94f113f1cc97d30d1540c9ad6eeb7e7deacf67b41cc6032e4a57d38282604051612549929190615542565b60405180910390a15050612598565b6003546001600160a01b031633146125825760405162461bcd60e51b81526004016103b590615727565b6009805462ff0000191662010000831515021790555b50565b600b5481565b6011546001600160a01b031681565b6003546001600160a01b031633146125da5760405162461bcd60e51b81526004016103b590615727565b6009805460ff1916911515919091179055565b600d5481565b60009081526008602090815260408083209383529290522060010154600160401b900460ff1690565b6002546001600160a01b031615612652576002546040516000916060916001600160a01b03909116906124d390849036906152d0565b6003546001600160a01b0316331461267c5760405162461bcd60e51b81526004016103b590615727565b6001600160a01b0381166000908152600560205260409020546126b15760405162461bcd60e51b81526004016103b5906155e7565b6001600160a01b03166000818152600560208181526040808420805485526006835290842080546001600160a01b031916905593835252905560048054600019019055565b60095462010000900460ff161561271f5760405162461bcd60e51b81526004016103b5906156e7565b3360009081526005602052604090205461274b5760405162461bcd60e51b81526004016103b590615697565b6004548251111561276e5760405162461bcd60e51b81526004016103b590615657565b60008686868660405160200161278794939291906152a4565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156127cf5750612888565b60006127dd828686866139c4565b90508015612885576040516323b872dd60e01b81526001600160a01b038816906323b872dd906128159030908c908b9060040161536c565b600060405180830381600087803b15801561282f57600080fd5b505af1158015612843573d6000803e3d6000fd5b505050507f709667d6c56243d41cfff52bd522879fc4e6a83ec590cb83d375956e8abd20648888888860405161287c949392919061546b565b60405180910390a15b50505b505050505050565b6006602052600090815260409020546001600160a01b031681565b600954610100900460ff1681565b60095462010000900460ff16156128e25760405162461bcd60e51b81526004016103b5906156e7565b3360009081526005602052604090205461290e5760405162461bcd60e51b81526004016103b590615697565b600454825111156129315760405162461bcd60e51b81526004016103b590615637565b60008686868660405160200161294a94939291906152a4565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156129925750612888565b60006129a0828686866139c4565b905080156128855760405163a9059cbb60e01b81526001600160a01b0388169063a9059cbb906129d6908b908a90600401615487565b602060405180830381600087803b1580156129f057600080fd5b505af1158015612a04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612a289190810190614664565b507f737af5f07a43576924ecf3d94bf486a3af309706430ade370f26198a89164b3f8888888860405161287c949392919061546b565b60045481565b6003546001600160a01b031681565b600e5481565b60095462010000900460ff1615612aa25760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff1615612aca5760405162461bcd60e51b81526004016103b590615687565b333214612ae95760405162461bcd60e51b81526004016103b590615707565b600c54341015612b0b5760405162461bcd60e51b81526004016103b5906157a7565b600c54341115612b4757600c546040513391340380156108fc02916000818181858888f19350505050158015612b45573d6000803e3d6000fd5b505b600c54600d805490910190556014548110612b745760405162461bcd60e51b81526004016103b5906157d7565b600060148281548110612b8357fe5b6000918252602082200191508154600160a81b900460ff166003811115612ba657fe5b14612bc35760405162461bcd60e51b81526004016103b5906157b7565b60028154600160a01b900460ff166003811115612bdc57fe5b1415612c205780546040517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd91611f80916001600160a01b03909116908590615487565b80546040517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a60380868916120bb916001600160a01b03909116908590615487565b600f5481565b6001600160a01b03909116600090815260176020526040902055565b6003546001600160a01b03163314612caa5760405162461bcd60e51b81526004016103b590615727565b633b9aca00811115612cce5760405162461bcd60e51b81526004016103b590615667565b600a55565b60095460009062010000900460ff1615612cff5760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff1615612d275760405162461bcd60e51b81526004016103b590615687565b333214612d465760405162461bcd60e51b81526004016103b590615707565b600a54341015612d685760405162461bcd60e51b81526004016103b590615777565b600a54341115612da457600a546040513391340380156108fc02916000818181858888f19350505050158015612da2573d6000803e3d6000fd5b505b600a54600d805490910190556000612dbc8333613c1c565b6011549091506001600160a01b0380831691161415612ded5760405162461bcd60e51b81526004016103b590615807565b6001600160a01b03811660009081526012602052604090205460011415612e265760405162461bcd60e51b81526004016103b590615617565b803b80612e3257600080fd5b604080516060810182526001600160a01b038481168252600260208301908152600093830184905260148054600181018083559190955283517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90950180546001600160a01b0319169590931694909417808355905190829060ff60a01b1916600160a01b836003811115612ec357fe5b021790555060408201518154829060ff60a81b1916600160a81b836003811115612ee957fe5b02179055505050506001600160a01b038216600090815260126020526040908190206001905560145490517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd916119869185916000190190615487565b6002546001600160a01b031681565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612fe05780601f10612fb557610100808354040283529160200191612fe0565b820191906000526020600020905b815481529060010190602001808311612fc357829003601f168201915b5050505050905090565b6001600160a01b0316600090815260056020526040902054151590565b6003546001600160a01b031633146130315760405162461bcd60e51b81526004016103b590615727565b6305f5e1008111156130555760405162461bcd60e51b81526004016103b5906157e7565b600c55565b6002546001600160a01b031615613090576002546040516000916060916001600160a01b03909116906124d390849036906152d0565b6003546001600160a01b031633146130ba5760405162461bcd60e51b81526004016103b590615727565b600980548215156101000261ff001990911617905550565b60176020526000908152604090205481565b303190565b60056020526000908152604090205481565b6003546001600160a01b031633146131255760405162461bcd60e51b81526004016103b590615727565b601055565b60168190556040517fef0cee5ab0ba082f9e7e2bec12702da8220ed5e3df2a40dfd209f30629dde0029061170e908390615837565b6002546001600160a01b031615613195576002546040516000916060916001600160a01b03909116906124d390849036906152d0565b6003546001600160a01b031633146131bf5760405162461bcd60e51b81526004016103b590615727565b6001600160a01b0381166131e55760405162461bcd60e51b81526004016103b590615767565b6001600160a01b0381166000908152600560205260409020541561321b5760405162461bcd60e51b81526004016103b590615747565b6101006004541061323e5760405162461bcd60e51b81526004016103b590615797565b60015b6101008111613273576000818152600660205260409020546001600160a01b031661326b57613273565b600101613241565b6001600160a01b0382166000818152600560209081526040808320859055938252600690529190912080546001600160a01b031916909117905560048054600101905550565b6040516331a9108f60e11b815260009030906001600160a01b03841690636352211e906132ea908790600401615837565b60206040518083038186803b15801561330257600080fd5b505afa158015613316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061333a9190810190614430565b6001600160a01b0316149392505050565b60095462010000900460ff16156133745760405162461bcd60e51b81526004016103b5906156e7565b336000908152600560205260409020546133a05760405162461bcd60e51b81526004016103b590615697565b600454825111156133c35760405162461bcd60e51b81526004016103b5906156d7565b6000868686866040516020016133dc9493929190615225565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156134245750612888565b6000613432828686866139c4565b90508015612885576001600160a01b03881686156108fc0287898015801561345957600080fd5b50806001603f1b1115801561346d57600080fd5b5080620f42401015801561348057600080fd5b50604051600081818185878a8ad09450505050501580156134a5573d6000803e3d6000fd5b507fa4c8013c715e65688c1594615ba73e95285332eae47ec97a53f2814e25483c2f3388888860405161287c94939291906153e4565b6003546001600160a01b031633146135055760405162461bcd60e51b81526004016103b590615727565b600e55565b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061353990859060040161530e565b60206040518083038186803b15801561355157600080fd5b505afa158015613565573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611dfc9190810190614727565b6002546001600160a01b0316156135bf576002546040516000916060916001600160a01b03909116906124d390849036906152d0565b6003546001600160a01b031633146135e95760405162461bcd60e51b81526004016103b590615727565b61259881613c48565b60095460009062010000900460ff161561361e5760405162461bcd60e51b81526004016103b5906156e7565b600954610100900460ff16156136465760405162461bcd60e51b81526004016103b590615687565b3332146136655760405162461bcd60e51b81526004016103b590615707565b6001600160a01b03831660009081526012602052604090205460011461369d5760405162461bcd60e51b81526004016103b590615627565b600b543410156136bf5760405162461bcd60e51b81526004016103b5906156b7565b600b543411156136fb57600b546040513391340380156108fc02916000818181858888f193505050501580156136f9573d6000803e3d6000fd5b505b600b54600d805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd906137379033903090879060040161531c565b600060405180830381600087803b15801561375157600080fd5b505af1158015613765573d6000803e3d6000fd5b5050505060136040518060e00160405280336001600160a01b0316815260200160006001600160401b03168152602001600363ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff168152602001848152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a338484600160138054905003604051611deb9493929190615387565b6003546001600160a01b031633146139735760405162461bcd60e51b81526004016103b590615727565b600f55565b60095460ff1681565b336000908152600560205260409020546139ad5760405162461bcd60e51b81526004016103b590615697565b6139b681613cb7565b156125985761259881613d87565b600081518351146139e75760405162461bcd60e51b81526004016103b590615717565b60095460ff1615613ae0576000805b8451811015613acb57600060056000868481518110613a1157fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000205490508060001415613a79576000858381518110613a5357fe5b60200260200101906001600160a01b031690816001600160a01b03168152505050613ac3565b600160001982011b838116613a915792831792613ac0565b6000868481518110613a9f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b50505b6001016139f6565b50613ad886868686613f59565b915050613c14565b6000848152600860209081526040808320888452909152812080546001820154919290916001600160401b0316905b8651811015613b8e576000613b40888381518110613b2957fe5b60200260200101518b61405490919063ffffffff16565b6001600160a01b03811660009081526005602052604090205490915080613b68575050613b86565b600160001982011b858116613b8257948517946001909401935b5050505b600101613b0f565b5081835560018301805467ffffffffffffffff19166001600160401b0383161790819055600160401b900460ff16158015613be85750600360045460020281613bd357fe5b60018501549190046001600160401b03909116115b15613c0c5750506001908101805460ff60401b1916600160401b1790559050613c14565b600093505050505b949350505050565b60006060613c29836140d6565b90506060613c3785836140fa565b805160209091012095945050505050565b6001600160a01b038116613c5b57600080fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600760209081526040808320805433855260059093529083205490919060016000199091011b808216613d7c5781811783556001808401805467ffffffffffffffff1981166001600160401b03918216909301169190911790819055600160401b900460ff16158015613d585750600360045460020281613d4357fe5b60018501549190046001600160401b03909116115b15613d7c5750506001908101805460ff60401b1916600160401b179055905061199a565b506000949350505050565b60606001600160a01b038216613e29576000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015613e1d5780601f10613df257610100808354040283529160200191613e1d565b820191906000526020600020905b815481529060010190602001808311613e0057829003601f168201915b50505050509050613ea1565b816001600160a01b031663a029b0966040518163ffffffff1660e01b815260040160006040518083038186803b158015613e6257600080fd5b505afa158015613e76573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613e9e91908101906146d5565b90505b7f633e5034510a0c7a27c0b9fb0d789cd980e5df67b48f7616e9c262426397847f600182604051613ed39291906155c2565b60405180910390a16002546040517f5c36dec2c0ed5b0dbd63872444c637e531efe754847dc745234e3a77b5383ffb91613f1a916001600160a01b03909116908590615450565b60405180910390a18051613f359060019060208401906141ac565b5050600280546001600160a01b0319166001600160a01b0392909216919091179055565b600083815260086020908152604080832087845282528083208151848152909201908190528290600990613f9290899088908890615562565b6020604051602081039080840390855afa158015613fb4573d6000803e3d6000fd5b505050602060405103519050613fc98161412d565b60018301805467ffffffffffffffff19166001600160401b03929092169190911790819055600160401b900460ff16158015614024575060036004546002028161400f57fe5b60018401549190046001600160401b03909116115b1561404757506001908101805460ff60401b1916600160401b1790559050613c14565b5060009695505050505050565b60208101516040820151604183015160009260ff90911691601b83101561407c57601b830192505b6001868484846040516000815260200160405260405161409f9493929190615596565b6020604051602081039080840390855afa1580156140c1573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b604080516001600160a01b0392909216600560a21b18601483015260348201905290565b604051606090614116908490604160f81b9085906020016152dd565b604051602081830303815290604052905092915050565b6000815b80156141495760019190910190600019810116614131565b50919050565b60408051606081019091526000808252602082019081526020016000905290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106141ed57805160ff191683800117855561421a565b8280016001018555821561421a579182015b8281111561421a5782518255916020019190600101906141ff565b5061422692915061422a565b5090565b6123f491905b808211156142265760008155600101614230565b803561424f81615991565b614258816158d1565b9392505050565b805161424f81615991565b600082601f83011261427b57600080fd5b813561428e6142898261586b565b615845565b915081818352602084019350602081019050838560208402820111156142b357600080fd5b60005b838110156142df57816142c98882614244565b84525060209283019291909101906001016142b6565b5050505092915050565b600082601f8301126142fa57600080fd5b81356143086142898261586b565b81815260209384019390925082018360005b838110156142df57813586016143308882614367565b845250602092830192919091019060010161431a565b8035611dfc816159a5565b8051611dfc816159a5565b8035611dfc816159ae565b600082601f83011261437857600080fd5b81356143866142898261588b565b915080825260208301602083018583830111156143a257600080fd5b6143ad838284615934565b50505092915050565b600082601f8301126143c757600080fd5b81516143d56142898261588b565b915080825260208301602083018583830111156143f157600080fd5b6143ad838284615940565b8051611dfc816159ae565b8035611dfc816159b7565b60006020828403121561442457600080fd5b6000613c148484614244565b60006020828403121561444257600080fd5b6000613c14848461425f565b60008060008060008060c0878903121561446757600080fd5b60006144738989614244565b965050602061448489828a0161435c565b955050604061449589828a0161435c565b94505060606144a689828a0161435c565b93505060808701356001600160401b038111156144c257600080fd5b6144ce89828a016142e9565b92505060a08701356001600160401b038111156144ea57600080fd5b6144f689828a0161426a565b9150509295509295509295565b600080600080600060a0868803121561451b57600080fd5b60006145278888614244565b95505060206145388882890161435c565b94505060406145498882890161435c565b93505060608601356001600160401b0381111561456557600080fd5b614571888289016142e9565b92505060808601356001600160401b0381111561458d57600080fd5b6145998882890161426a565b9150509295509295909350565b60008060008060008060c087890312156145bf57600080fd5b60006145cb8989614244565b965050602061448489828a01614244565b600080604083850312156145ef57600080fd5b60006145fb8585614244565b925050602061460c8582860161435c565b9150509250929050565b6000806040838503121561462957600080fd5b60006146358585614244565b925050602061460c85828601614407565b60006020828403121561465857600080fd5b6000613c148484614346565b60006020828403121561467657600080fd5b6000613c148484614351565b6000806040838503121561469557600080fd5b60006145fb858561435c565b6000602082840312156146b357600080fd5b81356001600160401b038111156146c957600080fd5b613c1484828501614367565b6000602082840312156146e757600080fd5b81516001600160401b038111156146fd57600080fd5b613c14848285016143b6565b60006020828403121561471b57600080fd5b6000613c14848461435c565b60006020828403121561473957600080fd5b6000613c1484846143fc565b6000806040838503121561475857600080fd5b6000614764858561435c565b925050602061460c85828601614244565b6000806040838503121561478857600080fd5b60006146358585614407565b60006147a083836147d4565b505060200190565b600061425883836148e6565b6147bd81615918565b82525050565b6147bd6147cf826158d1565b615970565b6147bd816158d1565b60006147e8826158c4565b6147f281856158c8565b93506147fd836158b2565b8060005b8381101561482b5781516148158882614794565b9750614820836158b2565b925050600101614801565b509495945050505050565b6000614841826158c4565b61484b81856158c8565b93508360208202850161485d856158b2565b8060005b85811015614897578484038952815161487a85826147a8565b9450614885836158b2565b60209a909a0199925050600101614861565b5091979650505050505050565b6147bd816158dc565b6147bd6148b9826158e1565b6123f4565b6147bd816123f4565b60006148d3838561199a565b93506148e0838584615934565b50500190565b60006148f1826158c4565b6148fb81856158c8565b935061490b818560208601615940565b61491481615981565b9093019392505050565b6000614929826158c4565b614933818561199a565b9350614943818560208601615940565b9290920192915050565b60008154600181166000811461496a5760018114614990576115f5565b607f600283041661497b81876158c8565b60ff19841681529550506020850192506115f5565b6002820461499e81876158c8565b95506149a9856158b8565b60005b828110156149c8578154888201526001909101906020016149ac565b9096019695505050505050565b60006149e2601a836158c8565b7f746869732061646472657373206973206e6f74206f7261636c65000000000000815260200192915050565b6000614a1b6020836158c8565b7f76616c7565206d757374206265203e3d206465706f7369744d696e5472633230815260200192915050565b6000614a54601c836158c8565b7f746f6b656e56616c756520213d206d73672e746f6b656e76616c756500000000815260200192915050565b6000614a8d6013836158c8565b721d1c98cc8c1059191c995cdcc81b585c1c1959606a1b815260200192915050565b6000614abc6014836158c8565b733737ba1030b71030b63637bbb2b2103a37b5b2b760611b815260200192915050565b6000614aec6026836158c8565b7f7769746864726177205452433230207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b6000614b346020836158c8565b7f6d73672e746f6b656e76616c7565206d757374203c3d2075696e7436344d6178815260200192915050565b6000614b6d6027836158c8565b7f776974686472617720545243373231207369676e73206e756d203e206f7261638152666c6573206e756d60c81b602082015260400192915050565b6000614bb66012836158c8565b710d8cae6e640e8d0c2dc406260606040a8a4b60731b815260200192915050565b6000614be46024836158c8565b7f776974686472617720545258207369676e73206e756d203e206f7261636c6573815263206e756d60e01b602082015260400192915050565b6000614c2a6008836158c8565b67697320706175736560c01b815260200192915050565b6000614c4e600a836158c8565b696e6f74206f7261636c6560b01b815260200192915050565b6000614c746014836158c8565b731d1c98cdcc8c5059191c995cdcc81b585c1c195960621b815260200192915050565b6000614ca4601d836158c8565b7f6d73672e76616c7565206e65656420203e3d206465706f736974466565000000815260200192915050565b6000614cdd6028836158c8565b7f6d757374206265747765656e206465706f7369744d696e54727820616e6420758152670d2dce86c689ac2f60c31b602082015260400192915050565b6000614d276026836158c8565b7f7769746864726177205452433130207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b6000614d6f6007836158c8565b66069732073746f760cc1b815260200192915050565b6000614d92601d836158c8565b7f6d73672e746f6b656e6964206d757374203c3d2075696e7436344d6178000000815260200192915050565b6000614dcb6012836158c8565b711b9bdd08185b1b1bddc818dbdb9d1c9858dd60721b815260200192915050565b6000614df9602a836158c8565b7f6572726f72207369674c6973742e6c656e677468206f72207369676e4f7261638152690d8cae65cd8cadccee8d60b31b602082015260400192915050565b6000614e456013836158c8565b7236b9b39739b2b73232b910109e9037bbb732b960691b815260200192915050565b6000614e74601b836158c8565b7f6e6f7420616c6c6f772066756e6374696f6e2066616c6c6261636b0000000000815260200192915050565b6000614ead601e836158c8565b7f74686973206164647265737320697320616c7265616479206f7261636c650000815260200192915050565b6000614ee66016836158c8565b751d1bdad95b925908084f481b5cd9cb9d1bdad95b9a5960521b815260200192915050565b6000614f18601b836158c8565b7f7468697320616464726573732063616e6e6f74206265207a65726f0000000000815260200192915050565b6000614f51601a836158c8565b7f74726332304d617070696e67466565206e6f7420656e6f756768000000000000815260200192915050565b6000614f8a601e836158c8565b7f5f73756e546f6b656e41646472657373203d3d20616464726573732830290000815260200192915050565b6000614fc3601c836158c8565b7f63616e6e6f74206d6f7265207468616e20323536206f7261636c657300000000815260200192915050565b6000614ffc601b836158c8565b7f6d73672e76616c7565206e65656420203e3d2072657472794665650000000000815260200192915050565b6000615035601d836158c8565b7f6d617070696e674d73672e73746174757320213d205355434345535320000000815260200192915050565b600061506e601f836158c8565b7f6e6f6e6365203e3d20757365724465706f7369744c6973742e6c656e67746800815260200192915050565b60006150a7601f836158c8565b7f6e6f6e6365203e3d20757365724d617070696e674c6973742e6c656e67746800815260200192915050565b60006150e06011836158c8565b700d8cae6e640e8d0c2dc4062606040a8a4b607b1b815260200192915050565b600061510d6018836158c8565b7f5452433230207472616e7366657246726f6d206572726f720000000000000000815260200192915050565b60006151466023836158c8565b7f6d61696e436861696e41646472657373203d3d2073756e546f6b656e4164647281526265737360e81b602082015260400192915050565b600061518b601b836158c8565b7f7472633732314d617070696e67466565206e6f7420656e6f7567680000000000815260200192915050565b60006151c46025836158c8565b7f746f6b656e76616c7565206d757374206265203e3d206465706f7369744d696e815264054726331360dc1b602082015260400192915050565b6147bd6148b9826123f4565b6147bd81615929565b6147bd81615906565b6147bd81615912565b600061523182876147c3565b60148201915061524182866151fe565b60208201915061525182856151fe565b60208201915061526182846151fe565b50602001949350505050565b600061527982866147c3565b60148201915061528982856151fe565b60208201915061529982846151fe565b506020019392505050565b60006152b082876147c3565b6014820191506152c082866147c3565b60148201915061525182856151fe565b6000613c148284866148c7565b60006152e9828661491e565b91506152f582856148ad565b600182019150615305828461491e565b95945050505050565b60208101611dfc82846147d4565b6060810161532a82866147b4565b61533760208301856147b4565b613c1460408301846148be565b6060810161535282866147b4565b61535f60208301856147b4565b613c14604083018461520a565b6060810161537a82866147b4565b61533760208301856147d4565b6080810161539582876147b4565b6153a260208301866147d4565b6153af60408301856148be565b61530560608301846148be565b608081016153ca82876147b4565b6153d760208301866147d4565b6153af6040830185615213565b608081016153f282876147b4565b6153a260208301866148be565b6060810161540d82866147b4565b61533760208301856148be565b6060810161542882866147b4565b6153376020830185615213565b6080810161544382876147b4565b6153d76020830186615213565b6040810161545e82856147d4565b61425860208301846147d4565b6080810161539582876147d4565b608081016153ca82876147d4565b6040810161549582856147d4565b61425860208301846148be565b6060810161540d82866147d4565b60e081016154be828a6147d4565b6154cb60208301896148be565b6154d860408301886148be565b6154e560608301876147d4565b6154f260808301866148be565b6154ff60a08301856148be565b61550c60c08301846148be565b98975050505050505050565b6060810161542882866147d4565b6080810161544382876147d4565b60208101611dfc82846148a4565b6040810161555082856148a4565b8181036020830152613c1481846148e6565b6060810161557082866148be565b81810360208301526155828185614836565b9050818103604083015261530581846147dd565b608081016155a482876148be565b6153a2602083018661521c565b6020808252810161425881846148e6565b604080825281016155d3818561494d565b90508181036020830152613c1481846148e6565b60208082528101611dfc816149d5565b60208082528101611dfc81614a0e565b60208082528101611dfc81614a47565b60208082528101611dfc81614a80565b60208082528101611dfc81614aaf565b60208082528101611dfc81614adf565b60208082528101611dfc81614b27565b60208082528101611dfc81614b60565b60208082528101611dfc81614ba9565b60208082528101611dfc81614bd7565b60208082528101611dfc81614c1d565b60208082528101611dfc81614c41565b60208082528101611dfc81614c67565b60208082528101611dfc81614c97565b60208082528101611dfc81614cd0565b60208082528101611dfc81614d1a565b60208082528101611dfc81614d62565b60208082528101611dfc81614d85565b60208082528101611dfc81614dbe565b60208082528101611dfc81614dec565b60208082528101611dfc81614e38565b60208082528101611dfc81614e67565b60208082528101611dfc81614ea0565b60208082528101611dfc81614ed9565b60208082528101611dfc81614f0b565b60208082528101611dfc81614f44565b60208082528101611dfc81614f7d565b60208082528101611dfc81614fb6565b60208082528101611dfc81614fef565b60208082528101611dfc81615028565b60208082528101611dfc81615061565b60208082528101611dfc8161509a565b60208082528101611dfc816150d3565b60208082528101611dfc81615100565b60208082528101611dfc81615139565b60208082528101611dfc8161517e565b60208082528101611dfc816151b7565b60208101611dfc82846148be565b6040518181016001600160401b038111828210171561586357600080fd5b604052919050565b60006001600160401b0382111561588157600080fd5b5060209081020190565b60006001600160401b038211156158a157600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b6000611dfc826158ee565b151590565b6001600160f81b03191690565b6001600160a01b031690565b6001600160a81b031690565b6001600160401b031690565b60ff1690565b6000611dfc826000611dfc826158d1565b6000611dfc82615906565b82818337506000910152565b60005b8381101561595b578181015183820152602001615943565b8381111561596a576000848401525b50505050565b6000611dfc826000611dfc8261598b565b601f01601f191690565b60601b90565b61599a816158fa565b811461259857600080fd5b61599a816158dc565b61599a816123f4565b61599a8161590656fea36474726f6e58206965ec7edb3c4cfb7006f6ee6c9aa9af66024fb75d461687afa01f1662a3cdde6c6578706572696d656e74616cf564736f6c637827302e352e392d646576656c6f702e323031392e382e32312b636f6d6d69742e31393035643732660064";
    String abi = "[{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRX\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"stop\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_sunTokenAddress\",\"type\":\"address\"}],\"name\":\"setSunTokenAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getMappingMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"uint64\"},{\"name\":\"tokenValue\",\"type\":\"uint64\"}],\"name\":\"depositTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getDepositMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"address\"}],\"name\":\"getXc\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"mappingFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"initVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"depositTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"mainToSideContractMap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setDepositFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"depositTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"retryFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"it\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"trcToken\"}],\"name\":\"getTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"codeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setStop\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"sunTokenAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setMultivalidatesignSwitch\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bonus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"withdrawDone\",\"outputs\":[{\"name\":\"r\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"delOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC721\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"indexOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"pause\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numOracles\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrx\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryMapping\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"address\"},{\"name\":\"setValue\",\"type\":\"uint256\"}],\"name\":\"setXc\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setMappingFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"logicAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCodeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"isOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setRetryFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setPause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"xc\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"oracleIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"setIt\",\"type\":\"uint256\"}],\"name\":\"setIt\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"addOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"hasNFT\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrx\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"getTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"}],\"name\":\"depositTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"multivalidatesignSwitch\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_logicAddress\",\"type\":\"address\"}],\"name\":\"setLogicAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"tokenValue\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"it\",\"type\":\"uint256\"}],\"name\":\"ea\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"MapKetValue\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"NewOracles\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"result\",\"type\":\"bool\"},{\"indexed\":false,\"name\":\"msg\",\"type\":\"bytes\"}],\"name\":\"DelegateResult\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"LogicAddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldVersion\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"newVersion\",\"type\":\"string\"}],\"name\":\"ChangeVersion\",\"type\":\"event\"}]\n";
    byte[] contractAddress = PublicMethed.deployContractForMain(contractName, abi, code, "",
        maxFeeLimit, 0L, 0, 10000,
        "0", 0, null, gateWatOwnerAddressKey,
        gateWatOwnerAddress, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    String parameN = "\"" + Base58.encode58Check(testOracleAddress) + "\"";

    byte[] inputN = Hex.decode(AbiUtil.parseMethod("oracleIndex(address)", parameN, false));
    TransactionExtention return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, inputN, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    int oracleIndexResult = ByteArray.toInt(return2.getConstantResult(0).toByteArray());
    Assert.assertTrue(oracleIndexResult == 1);

    String parame2 = "\"" + Base58.encode58Check(contractAddress) + "\"";

    input1 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame2, false));
    String ownerTrx1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1,
            1000000000,
            0l, "0", testOracleAddress, testOracle, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoOwnerTrx1 = PublicMethed
        .getTransactionInfoById(ownerTrx1, blockingStubFull);
    Assert.assertEquals(0, infoOwnerTrx1.get().getResultValue());

    input1 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
    return1 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);

    String ContractRestule1 = Hex.toHexString(return1.getConstantResult(0).toByteArray());

    String tmpAddress1 = ContractRestule1.substring(24);
    logger.info(tmpAddress1);
    String addressHex1 = "41" + tmpAddress1;
    logger.info("address_hex1: " + addressHex1);
    String addressFinal1 = Base58.encode58Check(ByteArray.fromHexString(addressHex1));
    logger.info("address_final1: " + addressFinal1);

    byte[] sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal1);
    Assert.assertNotNull(sideContractAddress1);
    Assert.assertEquals(Base58.encode58Check(contractAddress), addressFinal1);

    TransactionExtention return3 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input2, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    MinTrx = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return3.getConstantResult(0).toByteArray())));
    Assert.assertEquals(MinTrx, Long.valueOf(parame1));

    String methodStr3 = "setIt(uint256)";
    String parame4 = "3";
    byte[] input5 = Hex.decode(AbiUtil.parseMethod(methodStr3, parame4, false));

    String txid2 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            0,
            input5,
            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    logger.info("ownerTrx : " + txid2);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoById3 = PublicMethed
        .getTransactionInfoById(txid2, blockingStubFull);
    Assert.assertEquals(0, infoById3.get().getResultValue());

    List<String> retList = PublicMethedForDailybuild
        .getStrings(infoById3.get().getLogList().get(0).getData().toByteArray());
    Long actualSalt = ByteArray.toLong(ByteArray.fromHexString(retList.get(0)));
    Assert.assertTrue(Long.valueOf(parame4) == actualSalt);

    return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, inputN, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    int oracleIndexResultAfter = ByteArray.toInt(return2.getConstantResult(0).toByteArray());
    Assert.assertTrue(oracleIndexResult == oracleIndexResultAfter);

    String setXc = "setXc(address,uint256)";
    String parame5 = "\"" + Base58.encode58Check(mainGateWayAddressKey) + "\"," + 1001;

    byte[] input4 = Hex.decode(AbiUtil.parseMethod(setXc, parame5, false));

    String txid3 = PublicMethed
        .triggerContract(mainGateWayAddressKey, 0l, input4,
            1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    logger.info("ownerTrx : " + txid3);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    String getXc = "getXc(address)";
    String parame6 = "\"" + Base58.encode58Check(mainGateWayAddressKey) + "\"";
    byte[] input6 = Hex.decode(AbiUtil.parseMethod(getXc, parame6, false));

    String txid4 = PublicMethed
        .triggerContract(mainGateWayAddressKey, 0l, input6,
            1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    logger.info("ownerTrx : " + txid4);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    Optional<TransactionInfo> infoById4 = PublicMethed
        .getTransactionInfoById(txid4, blockingStubFull);
    Assert.assertEquals(0, infoById4.get().getResultValue());
    List<String> retList4 = PublicMethedForDailybuild
        .getStrings(infoById4.get().getLogList().get(0).getData().toByteArray());
    Long actualSalt1 = ByteArray.toLong(ByteArray.fromHexString(retList4.get(0)));
    logger.info("actualSalt1:" + actualSalt1);
    Assert.assertTrue(1001 == actualSalt1);

    Assert.assertTrue(PublicMethed
        .sendcoin(depositAddress, 2000000000L, testDepositAddress, testDepositTrx,
            blockingStubFull));
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Account accountMainBefore = PublicMethed.queryAccount(depositAddress, blockingStubFull);
    long accountMainBeforeBalance = accountMainBefore.getBalance();
    Assert.assertTrue(accountMainBeforeBalance == 2000000000L);
    Account accountSideBefore = PublicMethed.queryAccount(depositAddress, blockingSideStubFull);
    long accountSideBeforeBalance = accountSideBefore.getBalance();
    ByteString address = accountSideBefore.getAddress();
    String accountSideBeforeAddress = Base58.encode58Check(address.toByteArray());
    logger.info("accountSideBeforeAddress:" + accountSideBeforeAddress);
    Assert.assertEquals("3QJmnh", accountSideBeforeAddress);

    logger.info("accountBeforeBalance:" + accountMainBeforeBalance);
    logger.info("accountSideBeforeBalance:" + accountSideBeforeBalance);

    logger.info("transferTokenContractAddress:" + mainGateWayAddress);
    String methodStr = "depositTRX()";
    byte[] input = Hex.decode(AbiUtil.parseMethod(methodStr, "", false));

    long callValue = 1500000000;
    String txid = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            callValue,
            input,
            maxFeeLimit, 0, "", depositAddress, testKeyFordeposit, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    Optional<TransactionInfo> infoById = PublicMethed
        .getTransactionInfoById(txid, blockingStubFull);
    Assert.assertTrue(infoById.get().getResultValue() == 0);
    long fee = infoById.get().getFee();
    logger.info("fee:" + fee);
    Account accountMainAfter = PublicMethed.queryAccount(depositAddress, blockingStubFull);
    long accountMainAfterBalance = accountMainAfter.getBalance();
    logger.info("accountAfterBalance:" + accountMainAfterBalance);
    Assert.assertEquals(accountMainAfterBalance, accountMainBeforeBalance - fee - 1500000000);
    Account accountSideAfter = PublicMethed.queryAccount(depositAddress, blockingSideStubFull);
    long accountSideAfterBalance = accountSideAfter.getBalance();
    ByteString addressSideAfter = accountSideAfter.getAddress();
    String accountSideAfterAddress = Base58.encode58Check(addressSideAfter.toByteArray());
    logger.info("accountSideAfterAddress:" + accountSideAfterAddress);
    Assert.assertEquals(Base58.encode58Check(depositAddress), accountSideAfterAddress);
//    Assert.assertEquals(1500000000, accountSideAfterBalance);

    logger.info("sideGatewayAddress:" + sideGatewayAddress);
    long withdrawValue = 100;
    txid1 = PublicMethed
        .withdrawTrx(ChainIdAddress,
            sideGatewayAddress,
            withdrawValue,
            maxFeeLimit, depositAddress, testKeyFordeposit, blockingStubFull, blockingSideStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    Optional<TransactionInfo> infoById1 = PublicMethed
        .getTransactionInfoById(txid1, blockingSideStubFull);
    Assert.assertTrue(infoById1.get().getResultValue() == 0);
    long fee1 = infoById1.get().getFee();
    logger.info("fee1:" + fee1);
    Account accountSideAfterWithdraw = PublicMethed
        .queryAccount(depositAddress, blockingSideStubFull);
    long accountSideAfterWithdrawBalance = accountSideAfterWithdraw.getBalance();
    ByteString addressAfterWithdraw = accountSideAfterWithdraw.getAddress();
    String addressAfterWithdrawAddress = Base58
        .encode58Check(addressAfterWithdraw.toByteArray());
    logger.info("addressAfterWithdrawAddress:" + addressAfterWithdrawAddress);
    Assert.assertEquals(Base58.encode58Check(depositAddress), addressAfterWithdrawAddress);
    Assert.assertEquals(accountSideAfterBalance - fee1 - withdrawValue,
        accountSideAfterWithdrawBalance);
    Account accountMainAfterWithdraw = PublicMethed.queryAccount(depositAddress, blockingStubFull);
    long accountMainAfterWithdrawBalance = accountMainAfterWithdraw.getBalance();
    logger.info("accountAfterWithdrawBalance:" + accountMainAfterWithdrawBalance);
    Assert.assertEquals(accountMainAfterWithdrawBalance,
        accountMainAfterBalance + withdrawValue);
  }


  @Test(enabled = false, description = "DelegateCall in mainChain")
  public void test1DelegateCallMain002() {
    byte[] input = Hex.decode(AbiUtil.parseMethod("getCodeVersion()", "", false));
    TransactionExtention extention = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Assert.assertEquals(
        "00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005312e302e31000000000000000000000000000000000000000000000000000000",
        ByteArray.toHexString(extention.getConstantResult(0).toByteArray()));

    // deploy MainChainGateway
    String contractName = "MainChainGateway";
    String filePath = "src/test/resources/soliditycode/MainChainGatewaym002.sol";
    HashMap retMap = PublicMethedForDailybuild.getBycodeAbi(filePath, contractName);
    String code = retMap.get("byteCode").toString();
    String abi = retMap.get("abI").toString();

    byte[] contractAddress = PublicMethed.deployContractForMain(contractName, abi, code, "",
        maxFeeLimit, 0L, 0, 10000,
        "0", 0, null, gateWatOwnerAddressKey,
        gateWatOwnerAddress, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    String parameN = "\"" + Base58.encode58Check(testOracleAddress) + "\"";

    byte[] inputN = Hex.decode(AbiUtil.parseMethod("isOracle(address)", parameN, false));
    TransactionExtention return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, inputN, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    int oracleIndexResult = ByteArray.toInt(return2.getConstantResult(0).toByteArray());
    Assert.assertTrue(oracleIndexResult == 1);

    String parame2 = "\"" + Base58.encode58Check(contractAddress) + "\"";

    byte[] input1 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame2, false));
    String ownerTrx1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1,
            1000000000,
            0l, "0", testOracleAddress, testOracle, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoOwnerTrx1 = PublicMethed
        .getTransactionInfoById(ownerTrx1, blockingStubFull);
    Assert.assertEquals(0, infoOwnerTrx1.get().getResultValue());

    input1 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
    TransactionExtention return1 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);

    String ContractRestule1 = Hex.toHexString(return1.getConstantResult(0).toByteArray());

    String tmpAddress1 = ContractRestule1.substring(24);
    logger.info(tmpAddress1);
    String addressHex1 = "41" + tmpAddress1;
    logger.info("address_hex1: " + addressHex1);
    String addressFinal1 = Base58.encode58Check(ByteArray.fromHexString(addressHex1));
    logger.info("address_final1: " + addressFinal1);

    byte[] sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal1);
    Assert.assertNotNull(sideContractAddress1);
    Assert.assertEquals(Base58.encode58Check(contractAddress), addressFinal1);

    String methodStr3 = "setIt(uint256)";
    String parame3 = "3";
    byte[] input3 = Hex.decode(AbiUtil.parseMethod(methodStr3, parame3, false));

    String txid2 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            0,
            input3,
            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    logger.info("txid2 : " + txid2);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoById3 = PublicMethed
        .getTransactionInfoById(txid2, blockingStubFull);
    Assert.assertEquals(0, infoById3.get().getResultValue());
    Assert.assertTrue(infoById3.get().getInternalTransactionsList().get(0).getRejected());

    TransactionExtention extention2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Assert.assertEquals(
        "00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005312e302e33000000000000000000000000000000000000000000000000000000",
        ByteArray.toHexString(extention2.getConstantResult(0).toByteArray()));

    return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, inputN, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    int oracleIndexResultAfter = ByteArray.toInt(return2.getConstantResult(0).toByteArray());
    Assert.assertTrue(oracleIndexResult == oracleIndexResultAfter);
  }


  /**
   * constructor.
   */
  @Test(enabled = true, description = "DelegateCall in mainChain")
  public void test1DelegateCallMain003() {

    String parame = "true";
    byte[] input = Hex.decode(AbiUtil.parseMethod("setStop(bool)", parame, false));

    String txid = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input,
            1000000000,
            0l, "0", mainGateWayOwnerAddress, mainGateWayOwner, blockingStubFull);

    Optional<TransactionInfo> infoById = PublicMethed
        .getTransactionInfoById(txid, blockingSideStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);
    Assert.assertEquals(0, infoById.get().getResultValue());

    // deploy testMainContract
    String contractName = "testMainContract1";
    String code = "60c0604052600560808190527f312e302e3100000000000000000000000000000000000000000000000000000060a0908152620000409160009190620000ba565b506040805180820190915260058082527f312e302e3100000000000000000000000000000000000000000000000000000060209092019182526200008791600191620000ba565b506001600e819055600f8190556010556001600160401b03601555600380546001600160a01b031916331790556200015f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000fd57805160ff19168380011785556200012d565b828001600101855582156200012d579182015b828111156200012d57825182559160200191906001019062000110565b506200013b9291506200013f565b5090565b6200015c91905b808211156200013b576000815560010162000146565b90565b61572f806200016f6000396000f3fe6080604052600436106103355760003560e01c80638456cb59116101ab578063bedb86fb116100f7578063e6a9650811610095578063f73392921161006f578063f733929214610d85578063f821484314610d98578063fd0ee85614610dd2578063fdcfc3ef14610e0157610335565b8063e6a9650814610cd7578063e7fc18f814610d11578063f2fde38b14610d4b57610335565b8063d779039b116100d1578063d779039b14610bef578063df5dd1a514610c29578063dfd16f1914610c63578063dfe5924514610c9d57610335565b8063bedb86fb14610b4c578063cd9df8e114610b86578063d421c49b14610bb557610335565b806395a7a4a5116101645780639c1fcc4c1161013e5780639c1fcc4c14610a7a578063a029b09614610aa9578063a97e5c9314610ad8578063bc3d4d1614610b1257610335565b806395a7a4a5146109fe57806399b0322314610a2d57806399f4727a14610a6757610335565b80638456cb59146108f557806385815ac114610924578063898de9991461095e5780638da5cb5b1461098d578063905a0326146109bc57806392cb74b2146109eb57610335565b8063490ae2101161028557806367bf590311610223578063797a8ba3116101fd578063797a8ba31461080d5780637dc79375146108475780637f6e086014610881578063826be18e146108bb57610335565b806367bf59031461076857806373d9cb49146107a457806375b4d78c146107de57610335565b80635e0082c11161025f5780635e0082c11461069657806363e60230146106d0578063641657cb146106ff57806367a527931461073957610335565b8063490ae210146106255780634b398e991461065f5780635174169e1461066757610335565b806315c785e7116102f257806338d38c97116102cc57806338d38c97146105895780634171a537146105c55780634638c548146105d8578063473c3bd7146105eb57610335565b806315c785e7146105185780632ce61de91461054757806332caa1181461057657610335565b806304f06385146103a757806307da68f5146103e35780630a61c59f146104285780630b234183146104625780630c73e51f146104ab5780630fc7ad42146104cb575b60095462010000900460ff16156103675760405162461bcd60e51b815260040161035e906153ef565b60405180910390fd5b600954610100900460ff161561038f5760405162461bcd60e51b815260040161035e9061538f565b60405162461bcd60e51b815260040161035e9061543f565b3480156103b357600080fd5b50d380156103c057600080fd5b50d280156103cd57600080fd5b506103e16103dc36600461420b565b610e3b565b005b3480156103ef57600080fd5b50d380156103fc57600080fd5b50d2801561040957600080fd5b50610412610fa7565b60405161041f919061523c565b60405180910390f35b34801561043457600080fd5b50d3801561044157600080fd5b50d2801561044e57600080fd5b506103e161045d36600461411a565b610fb6565b34801561046e57600080fd5b50d3801561047b57600080fd5b50d2801561048857600080fd5b5061049c610497366004614411565b611028565b60405161041f939291906151aa565b6104be6104b936600461447d565b6110f1565b60405161041f919061553f565b3480156104d757600080fd5b50d380156104e457600080fd5b50d280156104f157600080fd5b50610505610500366004614411565b611491565b60405161041f97969594939291906151b8565b34801561052457600080fd5b50d3801561053157600080fd5b50d2801561053e57600080fd5b506104be61155a565b34801561055357600080fd5b50d3801561056057600080fd5b50d2801561056d57600080fd5b506104be611560565b6104be6105843660046143a9565b611566565b34801561059557600080fd5b50d380156105a257600080fd5b50d280156105af57600080fd5b506105b86117e0565b60405161041f91906152b9565b6104be6105d336600461431e565b61186e565b6103e16105e6366004614411565b611c43565b3480156105f757600080fd5b50d3801561060457600080fd5b50d2801561061157600080fd5b506104be61062036600461411a565b611f09565b34801561063157600080fd5b50d3801561063e57600080fd5b50d2801561064b57600080fd5b506103e161065a366004614411565b611f1b565b6104be611f6e565b34801561067357600080fd5b50d3801561068057600080fd5b50d2801561068d57600080fd5b506104be612238565b3480156106a257600080fd5b50d380156106af57600080fd5b50d280156106bc57600080fd5b506104be6106cb366004614411565b61223e565b3480156106dc57600080fd5b50d380156106e957600080fd5b50d280156106f657600080fd5b506105b861227e565b34801561070b57600080fd5b50d3801561071857600080fd5b50d2801561072557600080fd5b506103e161073436600461434e565b6122d8565b34801561074557600080fd5b50d3801561075257600080fd5b50d2801561075f57600080fd5b506104be61231e565b34801561077457600080fd5b50d3801561078157600080fd5b50d2801561078e57600080fd5b50610797612324565b60405161041f9190615016565b3480156107b057600080fd5b50d380156107bd57600080fd5b50d280156107ca57600080fd5b506103e16107d936600461434e565b612333565b3480156107ea57600080fd5b50d380156107f757600080fd5b50d2801561080457600080fd5b506104be612370565b34801561081957600080fd5b50d3801561082657600080fd5b50d2801561083357600080fd5b5061041261084236600461438a565b612376565b34801561085357600080fd5b50d3801561086057600080fd5b50d2801561086d57600080fd5b506103e161087c36600461411a565b61239f565b34801561088d57600080fd5b50d3801561089a57600080fd5b50d280156108a757600080fd5b506103e16108b63660046142ae565b612443565b3480156108c757600080fd5b50d380156108d457600080fd5b50d280156108e157600080fd5b506107976108f0366004614411565b6125dd565b34801561090157600080fd5b50d3801561090e57600080fd5b50d2801561091b57600080fd5b506104126125f8565b34801561093057600080fd5b50d3801561093d57600080fd5b50d2801561094a57600080fd5b506103e16109593660046142ae565b612606565b34801561096a57600080fd5b50d3801561097757600080fd5b50d2801561098457600080fd5b506104be6127ab565b34801561099957600080fd5b50d380156109a657600080fd5b50d280156109b357600080fd5b506107976127b1565b3480156109c857600080fd5b50d380156109d557600080fd5b50d280156109e257600080fd5b506104be6127c0565b6103e16109f9366004614411565b6127c6565b348015610a0a57600080fd5b50d38015610a1757600080fd5b50d28015610a2457600080fd5b506104be6129ab565b348015610a3957600080fd5b50d38015610a4657600080fd5b50d28015610a5357600080fd5b506103e1610a62366004614411565b6129b1565b6104be610a753660046143a9565b612a04565b348015610a8657600080fd5b50d38015610a9357600080fd5b50d28015610aa057600080fd5b50610797612c77565b348015610ab557600080fd5b50d38015610ac257600080fd5b50d28015610acf57600080fd5b506105b8612c86565b348015610ae457600080fd5b50d38015610af157600080fd5b50d28015610afe57600080fd5b50610412610b0d36600461411a565b612d1b565b348015610b1e57600080fd5b50d38015610b2b57600080fd5b50d28015610b3857600080fd5b506103e1610b47366004614411565b612d38565b348015610b5857600080fd5b50d38015610b6557600080fd5b50d28015610b7257600080fd5b506103e1610b8136600461434e565b612d8b565b348015610b9257600080fd5b50d38015610b9f57600080fd5b50d28015610bac57600080fd5b506104be612dcf565b348015610bc157600080fd5b50d38015610bce57600080fd5b50d28015610bdb57600080fd5b506104be610bea36600461411a565b612dd4565b348015610bfb57600080fd5b50d38015610c0857600080fd5b50d28015610c1557600080fd5b506103e1610c24366004614411565b612de6565b348015610c3557600080fd5b50d38015610c4257600080fd5b50d28015610c4f57600080fd5b506103e1610c5e36600461411a565b612e15565b348015610c6f57600080fd5b50d38015610c7c57600080fd5b50d28015610c8957600080fd5b50610412610c9836600461444d565b612f39565b348015610ca957600080fd5b50d38015610cb657600080fd5b50d28015610cc357600080fd5b506103e1610cd2366004614156565b612fcb565b348015610ce357600080fd5b50d38015610cf057600080fd5b50d28015610cfd57600080fd5b506103e1610d0c366004614411565b61315b565b348015610d1d57600080fd5b50d38015610d2a57600080fd5b50d28015610d3757600080fd5b506104be610d4636600461411a565b61318a565b348015610d5757600080fd5b50d38015610d6457600080fd5b50d28015610d7157600080fd5b506103e1610d8036600461411a565b613209565b6104be610d933660046142e4565b6132fa565b348015610da457600080fd5b50d38015610db157600080fd5b50d28015610dbe57600080fd5b506103e1610dcd366004614411565b613651565b348015610dde57600080fd5b50d38015610deb57600080fd5b50d28015610df857600080fd5b50610412613680565b348015610e0d57600080fd5b50d38015610e1a57600080fd5b50d28015610e2757600080fd5b506103e1610e3636600461411a565b613689565b60095462010000900460ff1615610e645760405162461bcd60e51b815260040161035e906153ef565b33600090815260056020526040902054610e905760405162461bcd60e51b815260040161035e9061539f565b60045482511115610eb35760405162461bcd60e51b815260040161035e9061537f565b6000858585604051602001610eca93929190614f75565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff1615610f125750610fa0565b6000610f20828686866136cc565b90508015610f9d576040516001600160a01b038816906002880280156108fc02916000818181858888f19350505050158015610f60573d6000803e3d6000fd5b507fee6b364f3c623639ef23c3c101adb53872193b08602d3013e6fec13e5a0a8c85878787604051610f9493929190615107565b60405180910390a15b50505b5050505050565b60095462010000900460ff1681565b6003546001600160a01b03163314610fe05760405162461bcd60e51b815260040161035e9061542f565b6001600160a01b0381166110065760405162461bcd60e51b815260040161035e9061548f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000611035613e57565b6014858154811061104257fe5b60009182526020918290206040805160608101909152910180546001600160a01b03811683529192909190830190600160a01b900460ff16600381111561108557fe5b600381111561109057fe5b81528154602090910190600160a81b900460ff1660038111156110af57fe5b60038111156110ba57fe5b905250805160208201519192509060038111156110d357fe5b826040015160038111156110e357fe5b935093509350509193909250565b60008282d36001600160401b0316826001600160401b0316146111265760405162461bcd60e51b815260040161035e9061545f565bd26001600160401b0316816001600160401b0316146111575760405162461bcd60e51b815260040161035e9061530f565b60095462010000900460ff16156111805760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156111a85760405162461bcd60e51b815260040161035e9061538f565b3332146111c75760405162461bcd60e51b815260040161035e9061540f565b600b543410156111e95760405162461bcd60e51b815260040161035e906153bf565b600b5434111561122557600b546040513391340380156108fc02916000818181858888f19350505050158015611223573d6000803e3d6000fd5b505b600b54600d80549091019055600f54d210156112535760405162461bcd60e51b815260040161035e9061552f565b601554d311156112755760405162461bcd60e51b815260040161035e906153ff565b601554d211156112975760405162461bcd60e51b815260040161035e9061534f565b60136040518060e00160405280336001600160a01b03168152602001866001600160401b03168152602001600163ffffffff16815260200160006001600160a01b03168152602001876001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b338686600160138054905003604051611477949392919061513d565b60405180910390a16013546000190192505b505092915050565b60008060008060008060006114a4613e78565b601389815481106114b157fe5b60009182526020918290206040805160e08101825260039390930290910180546001600160a01b038082168086526001600160401b03600160a01b808504821698880189905263ffffffff600160e01b958690048116978901889052600187015494851660608a0181905291850490921660808901819052949093041660a0870181905260029094015460c09096018690529f959e50929c50919a509098509650945092505050565b600a5481565b60105481565b60095460009062010000900460ff16156115925760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156115ba5760405162461bcd60e51b815260040161035e9061538f565b3332146115d95760405162461bcd60e51b815260040161035e9061540f565b600a543410156115fb5760405162461bcd60e51b815260040161035e9061551f565b600a5434111561163757600a546040513391340380156108fc02916000818181858888f19350505050158015611635573d6000803e3d6000fd5b505b600a54600d80549091019055600061164f8333613924565b6011549091506001600160a01b03808316911614156116805760405162461bcd60e51b815260040161035e9061550f565b6001600160a01b038116600090815260126020526040902054600114156116b95760405162461bcd60e51b815260040161035e906153af565b803b806116c557600080fd5b60408051606081019091526001600160a01b038316815260149060208101600381526020016000905281546001810180845560009384526020938490208351920180546001600160a01b0319166001600160a01b0390931692909217808355938301519093829060ff60a01b1916600160a01b83600381111561174457fe5b021790555060408201518154829060ff60a81b1916600160a81b83600381111561176a57fe5b02179055505050506001600160a01b038216600090815260126020526040908190206001905560145490517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a60380868916117c7918591600019019061518f565b60405180910390a150506014546000190190505b919050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118665780601f1061183b57610100808354040283529160200191611866565b820191906000526020600020905b81548152906001019060200180831161184957829003601f168201915b505050505081565b60095460009062010000900460ff161561189a5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156118c25760405162461bcd60e51b815260040161035e9061538f565b3332146118e15760405162461bcd60e51b815260040161035e9061540f565b6001600160a01b0383166000908152601260205260409020546001146119195760405162461bcd60e51b815260040161035e9061532f565b601054826001600160401b031610156119445760405162461bcd60e51b815260040161035e906152ff565b600b543410156119665760405162461bcd60e51b815260040161035e906153bf565b600b543411156119a257600b546040513391340380156108fc02916000818181858888f193505050501580156119a0573d6000803e3d6000fd5b505b600b54600d805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd906119de9033903090879060040161504c565b602060405180830381600087803b1580156119f857600080fd5b505af1158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a30919081019061436c565b611a4c5760405162461bcd60e51b815260040161035e906154ff565b60136040518060e00160405280336001600160a01b03168152602001846001600160401b03168152602001600263ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc7338484600160138054905003604051611c2c94939291906150c4565b60405180910390a150601354600019015b92915050565b60095462010000900460ff1615611c6c5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff1615611c945760405162461bcd60e51b815260040161035e9061538f565b333214611cb35760405162461bcd60e51b815260040161035e9061540f565b600c54341015611cd55760405162461bcd60e51b815260040161035e906154af565b600c54341115611d1157600c546040513391340380156108fc02916000818181858888f19350505050158015611d0f573d6000803e3d6000fd5b505b600c54600d805490910190556013548110611d3e5760405162461bcd60e51b815260040161035e906154cf565b600060138281548110611d4d57fe5b600091825260209091206003909102018054909150600160e01b900463ffffffff16611dce5780546040517f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff91611dc1916001600160a01b03821691600160a01b90046001600160401b0316908690615220565b60405180910390a1611f05565b8054600160e01b900463ffffffff1660021415611e3c57805460018201546040517f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc792611dc1926001600160a01b0380831693911691600160a01b90046001600160401b0316908790615181565b8054600160e01b900463ffffffff1660031415611e9e578054600182015460028301546040517fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a93611dc1936001600160a01b03918216939116918790615173565b805460018201546040517fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b92611efc926001600160a01b038216926001600160401b03600160a01b928390048116939290920490911690879061522e565b60405180910390a15b5050565b60126020526000908152604090205481565b6003546001600160a01b03163314611f455760405162461bcd60e51b815260040161035e9061542f565b6305f5e100811115611f695760405162461bcd60e51b815260040161035e906154ef565b600b55565b60095460009062010000900460ff1615611f9a5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff1615611fc25760405162461bcd60e51b815260040161035e9061538f565b333214611fe15760405162461bcd60e51b815260040161035e9061540f565b600b543410156120035760405162461bcd60e51b815260040161035e906153bf565b600b54600d805482019055600e54349190910390811080159061202857506015548111155b6120445760405162461bcd60e51b815260040161035e906153cf565b60136040518060e00160405280336001600160a01b03168152602001836001600160401b03168152602001600063ffffffff16815260200160006001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff338260016013805490500360405161222393929190615122565b60405180910390a15050601354600019015b90565b600c5481565b600030828015801561224f57600080fd5b50806001603f1b1115801561226357600080fd5b5080620f42401015801561227657600080fd5b50d192915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118665780601f1061183b57610100808354040283529160200191611866565b6003546001600160a01b031633146123025760405162461bcd60e51b815260040161035e9061542f565b60098054911515620100000262ff000019909216919091179055565b600b5481565b6011546001600160a01b031681565b6003546001600160a01b0316331461235d5760405162461bcd60e51b815260040161035e9061542f565b6009805460ff1916911515919091179055565b600d5481565b60009081526008602090815260408083209383529290522060010154600160401b900460ff1690565b6003546001600160a01b031633146123c95760405162461bcd60e51b815260040161035e9061542f565b6001600160a01b0381166000908152600560205260409020546123fe5760405162461bcd60e51b815260040161035e906152ef565b6001600160a01b03166000818152600560208181526040808420805485526006835290842080546001600160a01b031916905593835252905560048054600019019055565b60095462010000900460ff161561246c5760405162461bcd60e51b815260040161035e906153ef565b336000908152600560205260409020546124985760405162461bcd60e51b815260040161035e9061539f565b600454825111156124bb5760405162461bcd60e51b815260040161035e9061535f565b6000868686866040516020016124d49493929190614fac565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff161561251c57506125d5565b600061252a828686866136cc565b905080156125d2576040516323b872dd60e01b81526001600160a01b038816906323b872dd906125629030908c908b90600401615074565b600060405180830381600087803b15801561257c57600080fd5b505af1158015612590573d6000803e3d6000fd5b505050507f709667d6c56243d41cfff52bd522879fc4e6a83ec590cb83d375956e8abd2064888888886040516125c99493929190615173565b60405180910390a15b50505b505050505050565b6006602052600090815260409020546001600160a01b031681565b600954610100900460ff1681565b60095462010000900460ff161561262f5760405162461bcd60e51b815260040161035e906153ef565b3360009081526005602052604090205461265b5760405162461bcd60e51b815260040161035e9061539f565b6004548251111561267e5760405162461bcd60e51b815260040161035e9061533f565b6000868686866040516020016126979493929190614fac565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156126df57506125d5565b60006126ed828686866136cc565b905080156125d25760405163a9059cbb60e01b81526001600160a01b0388169063a9059cbb90612723908b908a9060040161518f565b602060405180830381600087803b15801561273d57600080fd5b505af1158015612751573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612775919081019061436c565b507f737af5f07a43576924ecf3d94bf486a3af309706430ade370f26198a89164b3f888888886040516125c99493929190615173565b60045481565b6003546001600160a01b031681565b600e5481565b60095462010000900460ff16156127ef5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156128175760405162461bcd60e51b815260040161035e9061538f565b3332146128365760405162461bcd60e51b815260040161035e9061540f565b600c543410156128585760405162461bcd60e51b815260040161035e906154af565b600c5434111561289457600c546040513391340380156108fc02916000818181858888f19350505050158015612892573d6000803e3d6000fd5b505b600c54600d8054909101905560145481106128c15760405162461bcd60e51b815260040161035e906154df565b6000601482815481106128d057fe5b6000918252602082200191508154600160a81b900460ff1660038111156128f357fe5b146129105760405162461bcd60e51b815260040161035e906154bf565b60028154600160a01b900460ff16600381111561292957fe5b141561296d5780546040517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd91611dc1916001600160a01b0390911690859061518f565b80546040517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a6038086891611efc916001600160a01b0390911690859061518f565b600f5481565b6003546001600160a01b031633146129db5760405162461bcd60e51b815260040161035e9061542f565b633b9aca008111156129ff5760405162461bcd60e51b815260040161035e9061536f565b600a55565b60095460009062010000900460ff1615612a305760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff1615612a585760405162461bcd60e51b815260040161035e9061538f565b333214612a775760405162461bcd60e51b815260040161035e9061540f565b600a54341015612a995760405162461bcd60e51b815260040161035e9061547f565b600a54341115612ad557600a546040513391340380156108fc02916000818181858888f19350505050158015612ad3573d6000803e3d6000fd5b505b600a54600d805490910190556000612aed8333613924565b6011549091506001600160a01b0380831691161415612b1e5760405162461bcd60e51b815260040161035e9061550f565b6001600160a01b03811660009081526012602052604090205460011415612b575760405162461bcd60e51b815260040161035e9061531f565b803b80612b6357600080fd5b604080516060810182526001600160a01b038481168252600260208301908152600093830184905260148054600181018083559190955283517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90950180546001600160a01b0319169590931694909417808355905190829060ff60a01b1916600160a01b836003811115612bf457fe5b021790555060408201518154829060ff60a81b1916600160a81b836003811115612c1a57fe5b02179055505050506001600160a01b038216600090815260126020526040908190206001905560145490517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd916117c7918591600019019061518f565b6002546001600160a01b031681565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612d115780601f10612ce657610100808354040283529160200191612d11565b820191906000526020600020905b815481529060010190602001808311612cf457829003601f168201915b5050505050905090565b6001600160a01b0316600090815260056020526040902054151590565b6003546001600160a01b03163314612d625760405162461bcd60e51b815260040161035e9061542f565b6305f5e100811115612d865760405162461bcd60e51b815260040161035e906154ef565b600c55565b6003546001600160a01b03163314612db55760405162461bcd60e51b815260040161035e9061542f565b600980549115156101000261ff0019909216919091179055565b303190565b60056020526000908152604090205481565b6003546001600160a01b03163314612e105760405162461bcd60e51b815260040161035e9061542f565b601055565b6003546001600160a01b03163314612e3f5760405162461bcd60e51b815260040161035e9061542f565b6001600160a01b038116612e655760405162461bcd60e51b815260040161035e9061546f565b6001600160a01b03811660009081526005602052604090205415612e9b5760405162461bcd60e51b815260040161035e9061544f565b61010060045410612ebe5760405162461bcd60e51b815260040161035e9061549f565b60015b6101008111612ef3576000818152600660205260409020546001600160a01b0316612eeb57612ef3565b600101612ec1565b6001600160a01b039091166000818152600560209081526040808320859055938252600690529190912080546001600160a01b0319169091179055600480546001019055565b6040516331a9108f60e11b815260009030906001600160a01b03841690636352211e90612f6a90879060040161553f565b60206040518083038186803b158015612f8257600080fd5b505afa158015612f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612fba9190810190614138565b6001600160a01b0316149392505050565b60095462010000900460ff1615612ff45760405162461bcd60e51b815260040161035e906153ef565b336000908152600560205260409020546130205760405162461bcd60e51b815260040161035e9061539f565b600454825111156130435760405162461bcd60e51b815260040161035e906153df565b60008686868660405160200161305c9493929190614f2d565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156130a457506125d5565b60006130b2828686866136cc565b905080156125d2576001600160a01b03881686156108fc028789801580156130d957600080fd5b50806001603f1b111580156130ed57600080fd5b5080620f42401015801561310057600080fd5b50604051600081818185878a8ad0945050505050158015613125573d6000803e3d6000fd5b507fa4c8013c715e65688c1594615ba73e95285332eae47ec97a53f2814e25483c2f338888886040516125c994939291906150ec565b6003546001600160a01b031633146131855760405162461bcd60e51b815260040161035e9061542f565b600e55565b6040516370a0823160e01b81526000906001600160a01b038316906370a08231906131b9908590600401615016565b60206040518083038186803b1580156131d157600080fd5b505afa1580156131e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3d919081019061442f565b6002546001600160a01b0316156132c4576002546040516000916060916001600160a01b039091169061323f9084903690614fd8565b600060405180830381855af49150503d806000811461327a576040519150601f19603f3d011682016040523d82523d6000602084013e61327f565b606091505b50915091507f8d47f8674d94f113f1cc97d30d1540c9ad6eeb7e7deacf67b41cc6032e4a57d382826040516132b592919061524a565b60405180910390a150506132f7565b6003546001600160a01b031633146132ee5760405162461bcd60e51b815260040161035e9061542f565b6132f781613950565b50565b60095460009062010000900460ff16156133265760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff161561334e5760405162461bcd60e51b815260040161035e9061538f565b33321461336d5760405162461bcd60e51b815260040161035e9061540f565b6001600160a01b0383166000908152601260205260409020546001146133a55760405162461bcd60e51b815260040161035e9061532f565b600b543410156133c75760405162461bcd60e51b815260040161035e906153bf565b600b5434111561340357600b546040513391340380156108fc02916000818181858888f19350505050158015613401573d6000803e3d6000fd5b505b600b54600d805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd9061343f90339030908790600401615024565b600060405180830381600087803b15801561345957600080fd5b505af115801561346d573d6000803e3d6000fd5b5050505060136040518060e00160405280336001600160a01b0316815260200160006001600160401b03168152602001600363ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff168152602001848152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a338484600160138054905003604051611c2c949392919061508f565b6003546001600160a01b0316331461367b5760405162461bcd60e51b815260040161035e9061542f565b600f55565b60095460ff1681565b336000908152600560205260409020546136b55760405162461bcd60e51b815260040161035e9061539f565b6136be816139bf565b156132f7576132f781613a8f565b600081518351146136ef5760405162461bcd60e51b815260040161035e9061541f565b60095460ff16156137e8576000805b84518110156137d35760006005600086848151811061371957fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020549050806000141561378157600085838151811061375b57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050506137cb565b600160001982011b83811661379957928317926137c8565b60008684815181106137a757fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b50505b6001016136fe565b506137e086868686613c61565b91505061391c565b6000848152600860209081526040808320888452909152812080546001820154919290916001600160401b0316905b865181101561389657600061384888838151811061383157fe5b60200260200101518b613d5c90919063ffffffff16565b6001600160a01b0381166000908152600560205260409020549091508061387057505061388e565b600160001982011b85811661388a57948517946001909401935b5050505b600101613817565b5081835560018301805467ffffffffffffffff19166001600160401b0383161790819055600160401b900460ff161580156138f057506003600454600202816138db57fe5b60018501549190046001600160401b03909116115b156139145750506001908101805460ff60401b1916600160401b179055905061391c565b600093505050505b949350505050565b6000606061393183613dde565b9050606061393f8583613e02565b805160209091012095945050505050565b6001600160a01b03811661396357600080fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600760209081526040808320805433855260059093529083205490919060016000199091011b808216613a845781811783556001808401805467ffffffffffffffff1981166001600160401b03918216909301169190911790819055600160401b900460ff16158015613a605750600360045460020281613a4b57fe5b60018501549190046001600160401b03909116115b15613a845750506001908101805460ff60401b1916600160401b17905590506117db565b506000949350505050565b60606001600160a01b038216613b31576000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015613b255780601f10613afa57610100808354040283529160200191613b25565b820191906000526020600020905b815481529060010190602001808311613b0857829003601f168201915b50505050509050613ba9565b816001600160a01b031663a029b0966040518163ffffffff1660e01b815260040160006040518083038186803b158015613b6a57600080fd5b505afa158015613b7e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613ba691908101906143dd565b90505b7f633e5034510a0c7a27c0b9fb0d789cd980e5df67b48f7616e9c262426397847f600182604051613bdb9291906152ca565b60405180910390a16002546040517f5c36dec2c0ed5b0dbd63872444c637e531efe754847dc745234e3a77b5383ffb91613c22916001600160a01b03909116908590615158565b60405180910390a18051613c3d906001906020840190613eb4565b5050600280546001600160a01b0319166001600160a01b0392909216919091179055565b600083815260086020908152604080832087845282528083208151848152909201908190528290600990613c9a9089908890889061526a565b6020604051602081039080840390855afa158015613cbc573d6000803e3d6000fd5b505050602060405103519050613cd181613e35565b60018301805467ffffffffffffffff19166001600160401b03929092169190911790819055600160401b900460ff16158015613d2c5750600360045460020281613d1757fe5b60018401549190046001600160401b03909116115b15613d4f57506001908101805460ff60401b1916600160401b179055905061391c565b5060009695505050505050565b60208101516040820151604183015160009260ff90911691601b831015613d8457601b830192505b60018684848460405160008152602001604052604051613da7949392919061529e565b6020604051602081039080840390855afa158015613dc9573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b604080516001600160a01b0392909216600560a21b18601483015260348201905290565b604051606090613e1e908490604160f81b908590602001614fe5565b604051602081830303815290604052905092915050565b6000815b8015613e515760019190910190600019810116613e39565b50919050565b60408051606081019091526000808252602082019081526020016000905290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613ef557805160ff1916838001178555613f22565b82800160010185558215613f22579182015b82811115613f22578251825591602001919060010190613f07565b50613f2e929150613f32565b5090565b61223591905b80821115613f2e5760008155600101613f38565b8035613f5781615699565b613f60816155d9565b9392505050565b8051613f5781615699565b600082601f830112613f8357600080fd5b8135613f96613f9182615573565b61554d565b91508181835260208401935060208101905083856020840282011115613fbb57600080fd5b60005b83811015613fe75781613fd18882613f4c565b8452506020928301929190910190600101613fbe565b5050505092915050565b600082601f83011261400257600080fd5b8135614010613f9182615573565b81815260209384019390925082018360005b83811015613fe75781358601614038888261406f565b8452506020928301929190910190600101614022565b8035611c3d816156ad565b8051611c3d816156ad565b8035611c3d816156b6565b600082601f83011261408057600080fd5b813561408e613f9182615593565b915080825260208301602083018583830111156140aa57600080fd5b6140b583828461563c565b50505092915050565b600082601f8301126140cf57600080fd5b81516140dd613f9182615593565b915080825260208301602083018583830111156140f957600080fd5b6140b5838284615648565b8051611c3d816156b6565b8035611c3d816156bf565b60006020828403121561412c57600080fd5b600061391c8484613f4c565b60006020828403121561414a57600080fd5b600061391c8484613f67565b60008060008060008060c0878903121561416f57600080fd5b600061417b8989613f4c565b965050602061418c89828a01614064565b955050604061419d89828a01614064565b94505060606141ae89828a01614064565b93505060808701356001600160401b038111156141ca57600080fd5b6141d689828a01613ff1565b92505060a08701356001600160401b038111156141f257600080fd5b6141fe89828a01613f72565b9150509295509295509295565b600080600080600060a0868803121561422357600080fd5b600061422f8888613f4c565b955050602061424088828901614064565b945050604061425188828901614064565b93505060608601356001600160401b0381111561426d57600080fd5b61427988828901613ff1565b92505060808601356001600160401b0381111561429557600080fd5b6142a188828901613f72565b9150509295509295909350565b60008060008060008060c087890312156142c757600080fd5b60006142d38989613f4c565b965050602061418c89828a01613f4c565b600080604083850312156142f757600080fd5b60006143038585613f4c565b925050602061431485828601614064565b9150509250929050565b6000806040838503121561433157600080fd5b600061433d8585613f4c565b92505060206143148582860161410f565b60006020828403121561436057600080fd5b600061391c848461404e565b60006020828403121561437e57600080fd5b600061391c8484614059565b6000806040838503121561439d57600080fd5b60006143038585614064565b6000602082840312156143bb57600080fd5b81356001600160401b038111156143d157600080fd5b61391c8482850161406f565b6000602082840312156143ef57600080fd5b81516001600160401b0381111561440557600080fd5b61391c848285016140be565b60006020828403121561442357600080fd5b600061391c8484614064565b60006020828403121561444157600080fd5b600061391c8484614104565b6000806040838503121561446057600080fd5b600061446c8585614064565b925050602061431485828601613f4c565b6000806040838503121561449057600080fd5b600061433d858561410f565b60006144a883836144dc565b505060200190565b6000613f6083836145ee565b6144c581615620565b82525050565b6144c56144d7826155d9565b615678565b6144c5816155d9565b60006144f0826155cc565b6144fa81856155d0565b9350614505836155ba565b8060005b8381101561453357815161451d888261449c565b9750614528836155ba565b925050600101614509565b509495945050505050565b6000614549826155cc565b61455381856155d0565b935083602082028501614565856155ba565b8060005b8581101561459f578484038952815161458285826144b0565b945061458d836155ba565b60209a909a0199925050600101614569565b5091979650505050505050565b6144c5816155e4565b6144c56145c1826155e9565b612235565b6144c581612235565b60006145db83856117db565b93506145e883858461563c565b50500190565b60006145f9826155cc565b61460381856155d0565b9350614613818560208601615648565b61461c81615689565b9093019392505050565b6000614631826155cc565b61463b81856117db565b935061464b818560208601615648565b9290920192915050565b600081546001811660008114614672576001811461469857611489565b607f600283041661468381876155d0565b60ff1984168152955050602085019250611489565b600282046146a681876155d0565b95506146b1856155c0565b60005b828110156146d0578154888201526001909101906020016146b4565b9096019695505050505050565b60006146ea601a836155d0565b7f746869732061646472657373206973206e6f74206f7261636c65000000000000815260200192915050565b60006147236020836155d0565b7f76616c7565206d757374206265203e3d206465706f7369744d696e5472633230815260200192915050565b600061475c601c836155d0565b7f746f6b656e56616c756520213d206d73672e746f6b656e76616c756500000000815260200192915050565b60006147956013836155d0565b721d1c98cc8c1059191c995cdcc81b585c1c1959606a1b815260200192915050565b60006147c46014836155d0565b733737ba1030b71030b63637bbb2b2103a37b5b2b760611b815260200192915050565b60006147f46026836155d0565b7f7769746864726177205452433230207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b600061483c6020836155d0565b7f6d73672e746f6b656e76616c7565206d757374203c3d2075696e7436344d6178815260200192915050565b60006148756027836155d0565b7f776974686472617720545243373231207369676e73206e756d203e206f7261638152666c6573206e756d60c81b602082015260400192915050565b60006148be6012836155d0565b710d8cae6e640e8d0c2dc406260606040a8a4b60731b815260200192915050565b60006148ec6024836155d0565b7f776974686472617720545258207369676e73206e756d203e206f7261636c6573815263206e756d60e01b602082015260400192915050565b60006149326008836155d0565b67697320706175736560c01b815260200192915050565b6000614956600a836155d0565b696e6f74206f7261636c6560b01b815260200192915050565b600061497c6014836155d0565b731d1c98cdcc8c5059191c995cdcc81b585c1c195960621b815260200192915050565b60006149ac601d836155d0565b7f6d73672e76616c7565206e65656420203e3d206465706f736974466565000000815260200192915050565b60006149e56028836155d0565b7f6d757374206265747765656e206465706f7369744d696e54727820616e6420758152670d2dce86c689ac2f60c31b602082015260400192915050565b6000614a2f6026836155d0565b7f7769746864726177205452433130207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b6000614a776007836155d0565b66069732073746f760cc1b815260200192915050565b6000614a9a601d836155d0565b7f6d73672e746f6b656e6964206d757374203c3d2075696e7436344d6178000000815260200192915050565b6000614ad36012836155d0565b711b9bdd08185b1b1bddc818dbdb9d1c9858dd60721b815260200192915050565b6000614b01602a836155d0565b7f6572726f72207369674c6973742e6c656e677468206f72207369676e4f7261638152690d8cae65cd8cadccee8d60b31b602082015260400192915050565b6000614b4d6013836155d0565b7236b9b39739b2b73232b910109e9037bbb732b960691b815260200192915050565b6000614b7c601b836155d0565b7f6e6f7420616c6c6f772066756e6374696f6e2066616c6c6261636b0000000000815260200192915050565b6000614bb5601e836155d0565b7f74686973206164647265737320697320616c7265616479206f7261636c650000815260200192915050565b6000614bee6016836155d0565b751d1bdad95b925908084f481b5cd9cb9d1bdad95b9a5960521b815260200192915050565b6000614c20601b836155d0565b7f7468697320616464726573732063616e6e6f74206265207a65726f0000000000815260200192915050565b6000614c59601a836155d0565b7f74726332304d617070696e67466565206e6f7420656e6f756768000000000000815260200192915050565b6000614c92601e836155d0565b7f5f73756e546f6b656e41646472657373203d3d20616464726573732830290000815260200192915050565b6000614ccb601c836155d0565b7f63616e6e6f74206d6f7265207468616e20323536206f7261636c657300000000815260200192915050565b6000614d04601b836155d0565b7f6d73672e76616c7565206e65656420203e3d2072657472794665650000000000815260200192915050565b6000614d3d601d836155d0565b7f6d617070696e674d73672e73746174757320213d205355434345535320000000815260200192915050565b6000614d76601f836155d0565b7f6e6f6e6365203e3d20757365724465706f7369744c6973742e6c656e67746800815260200192915050565b6000614daf601f836155d0565b7f6e6f6e6365203e3d20757365724d617070696e674c6973742e6c656e67746800815260200192915050565b6000614de86011836155d0565b700d8cae6e640e8d0c2dc4062606040a8a4b607b1b815260200192915050565b6000614e156018836155d0565b7f5452433230207472616e7366657246726f6d206572726f720000000000000000815260200192915050565b6000614e4e6023836155d0565b7f6d61696e436861696e41646472657373203d3d2073756e546f6b656e4164647281526265737360e81b602082015260400192915050565b6000614e93601b836155d0565b7f7472633732314d617070696e67466565206e6f7420656e6f7567680000000000815260200192915050565b6000614ecc6025836155d0565b7f746f6b656e76616c7565206d757374206265203e3d206465706f7369744d696e815264054726331360dc1b602082015260400192915050565b6144c56145c182612235565b6144c581615631565b6144c58161560e565b6144c58161561a565b6000614f3982876144cb565b601482019150614f498286614f06565b602082019150614f598285614f06565b602082019150614f698284614f06565b50602001949350505050565b6000614f8182866144cb565b601482019150614f918285614f06565b602082019150614fa18284614f06565b506020019392505050565b6000614fb882876144cb565b601482019150614fc882866144cb565b601482019150614f598285614f06565b600061391c8284866145cf565b6000614ff18286614626565b9150614ffd82856145b5565b60018201915061500d8284614626565b95945050505050565b60208101611c3d82846144dc565b6060810161503282866144bc565b61503f60208301856144bc565b61391c60408301846145c6565b6060810161505a82866144bc565b61506760208301856144bc565b61391c6040830184614f12565b6060810161508282866144bc565b61503f60208301856144dc565b6080810161509d82876144bc565b6150aa60208301866144dc565b6150b760408301856145c6565b61500d60608301846145c6565b608081016150d282876144bc565b6150df60208301866144dc565b6150b76040830185614f1b565b608081016150fa82876144bc565b6150aa60208301866145c6565b6060810161511582866144bc565b61503f60208301856145c6565b6060810161513082866144bc565b61503f6020830185614f1b565b6080810161514b82876144bc565b6150df6020830186614f1b565b6040810161516682856144dc565b613f6060208301846144dc565b6080810161509d82876144dc565b608081016150d282876144dc565b6040810161519d82856144dc565b613f6060208301846145c6565b6060810161511582866144dc565b60e081016151c6828a6144dc565b6151d360208301896145c6565b6151e060408301886145c6565b6151ed60608301876144dc565b6151fa60808301866145c6565b61520760a08301856145c6565b61521460c08301846145c6565b98975050505050505050565b6060810161513082866144dc565b6080810161514b82876144dc565b60208101611c3d82846145ac565b6040810161525882856145ac565b818103602083015261391c81846145ee565b6060810161527882866145c6565b818103602083015261528a818561453e565b9050818103604083015261500d81846144e5565b608081016152ac82876145c6565b6150aa6020830186614f24565b60208082528101613f6081846145ee565b604080825281016152db8185614655565b9050818103602083015261391c81846145ee565b60208082528101611c3d816146dd565b60208082528101611c3d81614716565b60208082528101611c3d8161474f565b60208082528101611c3d81614788565b60208082528101611c3d816147b7565b60208082528101611c3d816147e7565b60208082528101611c3d8161482f565b60208082528101611c3d81614868565b60208082528101611c3d816148b1565b60208082528101611c3d816148df565b60208082528101611c3d81614925565b60208082528101611c3d81614949565b60208082528101611c3d8161496f565b60208082528101611c3d8161499f565b60208082528101611c3d816149d8565b60208082528101611c3d81614a22565b60208082528101611c3d81614a6a565b60208082528101611c3d81614a8d565b60208082528101611c3d81614ac6565b60208082528101611c3d81614af4565b60208082528101611c3d81614b40565b60208082528101611c3d81614b6f565b60208082528101611c3d81614ba8565b60208082528101611c3d81614be1565b60208082528101611c3d81614c13565b60208082528101611c3d81614c4c565b60208082528101611c3d81614c85565b60208082528101611c3d81614cbe565b60208082528101611c3d81614cf7565b60208082528101611c3d81614d30565b60208082528101611c3d81614d69565b60208082528101611c3d81614da2565b60208082528101611c3d81614ddb565b60208082528101611c3d81614e08565b60208082528101611c3d81614e41565b60208082528101611c3d81614e86565b60208082528101611c3d81614ebf565b60208101611c3d82846145c6565b6040518181016001600160401b038111828210171561556b57600080fd5b604052919050565b60006001600160401b0382111561558957600080fd5b5060209081020190565b60006001600160401b038211156155a957600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b6000611c3d826155f6565b151590565b6001600160f81b03191690565b6001600160a01b031690565b6001600160a81b031690565b6001600160401b031690565b60ff1690565b6000611c3d826000611c3d826155d9565b6000611c3d8261560e565b82818337506000910152565b60005b8381101561566357818101518382015260200161564b565b83811115615672576000848401525b50505050565b6000611c3d826000611c3d82615693565b601f01601f191690565b60601b90565b6156a281615602565b81146132f757600080fd5b6156a2816155e4565b6156a281612235565b6156a28161560e56fea36474726f6e5820c2853b81470de0dc070f2507befd45f77788ee29b8517f7c9dc76c4c90fd35736c6578706572696d656e74616cf564736f6c637827302e352e392d646576656c6f702e323031392e382e32312b636f6d6d69742e31393035643732660064";
    String abi = "[{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRX\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"stop\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_sunTokenAddress\",\"type\":\"address\"}],\"name\":\"setSunTokenAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getMappingMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"uint64\"},{\"name\":\"tokenValue\",\"type\":\"uint64\"}],\"name\":\"depositTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getDepositMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"mappingFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"initVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"depositTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"mainToSideContractMap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setDepositFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"depositTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"retryFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"trcToken\"}],\"name\":\"getTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"codeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setStop\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"sunTokenAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setMultivalidatesignSwitch\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bonus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"withdrawDone\",\"outputs\":[{\"name\":\"r\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"delOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC721\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"indexOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"pause\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numOracles\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrx\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryMapping\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setMappingFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"logicAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCodeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"isOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setRetryFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setPause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"oracleIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"addOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"hasNFT\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrx\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"getTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"}],\"name\":\"depositTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"multivalidatesignSwitch\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_logicAddress\",\"type\":\"address\"}],\"name\":\"setLogicAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"tokenValue\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"NewOracles\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"result\",\"type\":\"bool\"},{\"indexed\":false,\"name\":\"msg\",\"type\":\"bytes\"}],\"name\":\"DelegateResult\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"LogicAddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldVersion\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"newVersion\",\"type\":\"string\"}],\"name\":\"ChangeVersion\",\"type\":\"event\"}]\n";
    byte[] contractAddress2 = PublicMethed.deployContractForMain(contractName, abi, code, "",
        maxFeeLimit, 0L, 0, 10000,
        "0", 0, null, gateWatOwnerAddressKey,
        gateWatOwnerAddress, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    String parame2 = "\"" + Base58.encode58Check(contractAddress2) + "\"";

    byte[] input5 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame2, false));
    String ownerTrx1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input5,
            1000000000,
            0l, "0", testOracleAddress, testOracle, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoOwnerTrx1 = PublicMethed
        .getTransactionInfoById(ownerTrx1, blockingStubFull);
    Assert.assertEquals(0, infoOwnerTrx1.get().getResultValue());

    byte[] input6 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
    TransactionExtention return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input6, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);

    String ContractResult1 = Hex.toHexString(return2.getConstantResult(0).toByteArray());

    String tmpAddress2 = ContractResult1.substring(24);
    logger.info(tmpAddress2);
    String addressHex2 = "41" + tmpAddress2;
    logger.info("address_hex1: " + addressHex2);
    String addressFinal2 = Base58.encode58Check(ByteArray.fromHexString(addressHex2));
    logger.info("address_final2: " + addressFinal2);

    byte[] sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal2);
    Assert.assertNotNull(sideContractAddress1);
    Assert.assertEquals(Base58.encode58Check(contractAddress2), addressFinal2);

    String parame1 = "false";
    byte[] input1 = Hex.decode(AbiUtil.parseMethod("setStop(bool)", parame1, false));

    String txid1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1,
            1000000000,
            0l, "0", mainGateWayOwnerAddress, mainGateWayOwner, blockingStubFull);

    Optional<TransactionInfo> infoById1 = PublicMethed
        .getTransactionInfoById(txid1, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    Assert.assertEquals(0, infoById1.get().getResultValue());

    String parame5 = "true";
    byte[] input2 = Hex.decode(AbiUtil.parseMethod("setPause(bool)", parame5, false));

    String txid2 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input2,
            1000000000,
            0l, "0", mainGateWayOwnerAddress, mainGateWayOwner, blockingStubFull);
    Optional<TransactionInfo> infoById2 = PublicMethed
        .getTransactionInfoById(txid2, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    String hex = infoById2.get().getContractAddress().toStringUtf8();
    logger.info("result:" + hex);

    Assert.assertEquals(0, infoById2.get().getResultValue());

    contractAddress2 = PublicMethed.deployContractForMain(contractName, abi, code, "",
        maxFeeLimit, 0L, 0, 10000,
        "0", 0, null, gateWatOwnerAddressKey,
        gateWatOwnerAddress, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    String parame6 = "\"" + Base58.encode58Check(contractAddress2) + "\"";

    byte[] input7 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame6, false));
    String ownerTrx7 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input7,
            1000000000,
            0l, "0", testOracleAddress, testOracle, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoOwnerTrx7 = PublicMethed
        .getTransactionInfoById(ownerTrx7, blockingStubFull);
    Assert.assertEquals(0, infoOwnerTrx7.get().getResultValue());

    input6 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
    return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input6, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);

    ContractResult1 = Hex.toHexString(return2.getConstantResult(0).toByteArray());

    tmpAddress2 = ContractResult1.substring(24);
    logger.info(tmpAddress2);
    addressHex2 = "41" + tmpAddress2;
    logger.info("address_hex1: " + addressHex2);
    addressFinal2 = Base58.encode58Check(ByteArray.fromHexString(addressHex2));
    logger.info("address_final2: " + addressFinal2);

    sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal2);
    Assert.assertNotNull(sideContractAddress1);
    Assert.assertEquals(Base58.encode58Check(contractAddress2), addressFinal2);

    String parame3 = "false";
    byte[] input3 = Hex.decode(AbiUtil.parseMethod("setPause(bool)", parame3, false));

    String txid3 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input3,
            1000000000,
            0l, "0", mainGateWayOwnerAddress, mainGateWayOwner, blockingStubFull);
    Optional<TransactionInfo> infoById3 = PublicMethed
        .getTransactionInfoById(txid3, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    String hex3 = infoById3.get().getContractAddress().toStringUtf8();
    logger.info("result:" + hex3);

    Assert.assertEquals(0, infoById3.get().getResultValue());

  }

  /**
   * constructor.
   */
  @Test(enabled = true, description = "DelegateCall in mainChain")
  public void test1DelegateCallMain004() {

    // deploy testMainContract
    String contractName = "testMainContract1";
    String code = "60c0604052600560808190527f312e302e3100000000000000000000000000000000000000000000000000000060a0908152620000409160009190620000ba565b506040805180820190915260058082527f312e302e3100000000000000000000000000000000000000000000000000000060209092019182526200008791600191620000ba565b506001600e819055600f8190556010556001600160401b03601555600380546001600160a01b031916331790556200015f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000fd57805160ff19168380011785556200012d565b828001600101855582156200012d579182015b828111156200012d57825182559160200191906001019062000110565b506200013b9291506200013f565b5090565b6200015c91905b808211156200013b576000815560010162000146565b90565b61572f806200016f6000396000f3fe6080604052600436106103355760003560e01c80638456cb59116101ab578063bedb86fb116100f7578063e6a9650811610095578063f73392921161006f578063f733929214610d85578063f821484314610d98578063fd0ee85614610dd2578063fdcfc3ef14610e0157610335565b8063e6a9650814610cd7578063e7fc18f814610d11578063f2fde38b14610d4b57610335565b8063d779039b116100d1578063d779039b14610bef578063df5dd1a514610c29578063dfd16f1914610c63578063dfe5924514610c9d57610335565b8063bedb86fb14610b4c578063cd9df8e114610b86578063d421c49b14610bb557610335565b806395a7a4a5116101645780639c1fcc4c1161013e5780639c1fcc4c14610a7a578063a029b09614610aa9578063a97e5c9314610ad8578063bc3d4d1614610b1257610335565b806395a7a4a5146109fe57806399b0322314610a2d57806399f4727a14610a6757610335565b80638456cb59146108f557806385815ac114610924578063898de9991461095e5780638da5cb5b1461098d578063905a0326146109bc57806392cb74b2146109eb57610335565b8063490ae2101161028557806367bf590311610223578063797a8ba3116101fd578063797a8ba31461080d5780637dc79375146108475780637f6e086014610881578063826be18e146108bb57610335565b806367bf59031461076857806373d9cb49146107a457806375b4d78c146107de57610335565b80635e0082c11161025f5780635e0082c11461069657806363e60230146106d0578063641657cb146106ff57806367a527931461073957610335565b8063490ae210146106255780634b398e991461065f5780635174169e1461066757610335565b806315c785e7116102f257806338d38c97116102cc57806338d38c97146105895780634171a537146105c55780634638c548146105d8578063473c3bd7146105eb57610335565b806315c785e7146105185780632ce61de91461054757806332caa1181461057657610335565b806304f06385146103a757806307da68f5146103e35780630a61c59f146104285780630b234183146104625780630c73e51f146104ab5780630fc7ad42146104cb575b60095462010000900460ff16156103675760405162461bcd60e51b815260040161035e906153ef565b60405180910390fd5b600954610100900460ff161561038f5760405162461bcd60e51b815260040161035e9061538f565b60405162461bcd60e51b815260040161035e9061543f565b3480156103b357600080fd5b50d380156103c057600080fd5b50d280156103cd57600080fd5b506103e16103dc36600461420b565b610e3b565b005b3480156103ef57600080fd5b50d380156103fc57600080fd5b50d2801561040957600080fd5b50610412610fa7565b60405161041f919061523c565b60405180910390f35b34801561043457600080fd5b50d3801561044157600080fd5b50d2801561044e57600080fd5b506103e161045d36600461411a565b610fb6565b34801561046e57600080fd5b50d3801561047b57600080fd5b50d2801561048857600080fd5b5061049c610497366004614411565b611028565b60405161041f939291906151aa565b6104be6104b936600461447d565b6110f1565b60405161041f919061553f565b3480156104d757600080fd5b50d380156104e457600080fd5b50d280156104f157600080fd5b50610505610500366004614411565b611491565b60405161041f97969594939291906151b8565b34801561052457600080fd5b50d3801561053157600080fd5b50d2801561053e57600080fd5b506104be61155a565b34801561055357600080fd5b50d3801561056057600080fd5b50d2801561056d57600080fd5b506104be611560565b6104be6105843660046143a9565b611566565b34801561059557600080fd5b50d380156105a257600080fd5b50d280156105af57600080fd5b506105b86117e0565b60405161041f91906152b9565b6104be6105d336600461431e565b61186e565b6103e16105e6366004614411565b611c43565b3480156105f757600080fd5b50d3801561060457600080fd5b50d2801561061157600080fd5b506104be61062036600461411a565b611f09565b34801561063157600080fd5b50d3801561063e57600080fd5b50d2801561064b57600080fd5b506103e161065a366004614411565b611f1b565b6104be611f6e565b34801561067357600080fd5b50d3801561068057600080fd5b50d2801561068d57600080fd5b506104be612238565b3480156106a257600080fd5b50d380156106af57600080fd5b50d280156106bc57600080fd5b506104be6106cb366004614411565b61223e565b3480156106dc57600080fd5b50d380156106e957600080fd5b50d280156106f657600080fd5b506105b861227e565b34801561070b57600080fd5b50d3801561071857600080fd5b50d2801561072557600080fd5b506103e161073436600461434e565b6122d8565b34801561074557600080fd5b50d3801561075257600080fd5b50d2801561075f57600080fd5b506104be61231e565b34801561077457600080fd5b50d3801561078157600080fd5b50d2801561078e57600080fd5b50610797612324565b60405161041f9190615016565b3480156107b057600080fd5b50d380156107bd57600080fd5b50d280156107ca57600080fd5b506103e16107d936600461434e565b612333565b3480156107ea57600080fd5b50d380156107f757600080fd5b50d2801561080457600080fd5b506104be612370565b34801561081957600080fd5b50d3801561082657600080fd5b50d2801561083357600080fd5b5061041261084236600461438a565b612376565b34801561085357600080fd5b50d3801561086057600080fd5b50d2801561086d57600080fd5b506103e161087c36600461411a565b61239f565b34801561088d57600080fd5b50d3801561089a57600080fd5b50d280156108a757600080fd5b506103e16108b63660046142ae565b612443565b3480156108c757600080fd5b50d380156108d457600080fd5b50d280156108e157600080fd5b506107976108f0366004614411565b6125dd565b34801561090157600080fd5b50d3801561090e57600080fd5b50d2801561091b57600080fd5b506104126125f8565b34801561093057600080fd5b50d3801561093d57600080fd5b50d2801561094a57600080fd5b506103e16109593660046142ae565b612606565b34801561096a57600080fd5b50d3801561097757600080fd5b50d2801561098457600080fd5b506104be6127ab565b34801561099957600080fd5b50d380156109a657600080fd5b50d280156109b357600080fd5b506107976127b1565b3480156109c857600080fd5b50d380156109d557600080fd5b50d280156109e257600080fd5b506104be6127c0565b6103e16109f9366004614411565b6127c6565b348015610a0a57600080fd5b50d38015610a1757600080fd5b50d28015610a2457600080fd5b506104be6129ab565b348015610a3957600080fd5b50d38015610a4657600080fd5b50d28015610a5357600080fd5b506103e1610a62366004614411565b6129b1565b6104be610a753660046143a9565b612a04565b348015610a8657600080fd5b50d38015610a9357600080fd5b50d28015610aa057600080fd5b50610797612c77565b348015610ab557600080fd5b50d38015610ac257600080fd5b50d28015610acf57600080fd5b506105b8612c86565b348015610ae457600080fd5b50d38015610af157600080fd5b50d28015610afe57600080fd5b50610412610b0d36600461411a565b612d1b565b348015610b1e57600080fd5b50d38015610b2b57600080fd5b50d28015610b3857600080fd5b506103e1610b47366004614411565b612d38565b348015610b5857600080fd5b50d38015610b6557600080fd5b50d28015610b7257600080fd5b506103e1610b8136600461434e565b612d8b565b348015610b9257600080fd5b50d38015610b9f57600080fd5b50d28015610bac57600080fd5b506104be612dcf565b348015610bc157600080fd5b50d38015610bce57600080fd5b50d28015610bdb57600080fd5b506104be610bea36600461411a565b612dd4565b348015610bfb57600080fd5b50d38015610c0857600080fd5b50d28015610c1557600080fd5b506103e1610c24366004614411565b612de6565b348015610c3557600080fd5b50d38015610c4257600080fd5b50d28015610c4f57600080fd5b506103e1610c5e36600461411a565b612e15565b348015610c6f57600080fd5b50d38015610c7c57600080fd5b50d28015610c8957600080fd5b50610412610c9836600461444d565b612f39565b348015610ca957600080fd5b50d38015610cb657600080fd5b50d28015610cc357600080fd5b506103e1610cd2366004614156565b612fcb565b348015610ce357600080fd5b50d38015610cf057600080fd5b50d28015610cfd57600080fd5b506103e1610d0c366004614411565b61315b565b348015610d1d57600080fd5b50d38015610d2a57600080fd5b50d28015610d3757600080fd5b506104be610d4636600461411a565b61318a565b348015610d5757600080fd5b50d38015610d6457600080fd5b50d28015610d7157600080fd5b506103e1610d8036600461411a565b613209565b6104be610d933660046142e4565b6132fa565b348015610da457600080fd5b50d38015610db157600080fd5b50d28015610dbe57600080fd5b506103e1610dcd366004614411565b613651565b348015610dde57600080fd5b50d38015610deb57600080fd5b50d28015610df857600080fd5b50610412613680565b348015610e0d57600080fd5b50d38015610e1a57600080fd5b50d28015610e2757600080fd5b506103e1610e3636600461411a565b613689565b60095462010000900460ff1615610e645760405162461bcd60e51b815260040161035e906153ef565b33600090815260056020526040902054610e905760405162461bcd60e51b815260040161035e9061539f565b60045482511115610eb35760405162461bcd60e51b815260040161035e9061537f565b6000858585604051602001610eca93929190614f75565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff1615610f125750610fa0565b6000610f20828686866136cc565b90508015610f9d576040516001600160a01b038816906002880280156108fc02916000818181858888f19350505050158015610f60573d6000803e3d6000fd5b507fee6b364f3c623639ef23c3c101adb53872193b08602d3013e6fec13e5a0a8c85878787604051610f9493929190615107565b60405180910390a15b50505b5050505050565b60095462010000900460ff1681565b6003546001600160a01b03163314610fe05760405162461bcd60e51b815260040161035e9061542f565b6001600160a01b0381166110065760405162461bcd60e51b815260040161035e9061548f565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000806000611035613e57565b6014858154811061104257fe5b60009182526020918290206040805160608101909152910180546001600160a01b03811683529192909190830190600160a01b900460ff16600381111561108557fe5b600381111561109057fe5b81528154602090910190600160a81b900460ff1660038111156110af57fe5b60038111156110ba57fe5b905250805160208201519192509060038111156110d357fe5b826040015160038111156110e357fe5b935093509350509193909250565b60008282d36001600160401b0316826001600160401b0316146111265760405162461bcd60e51b815260040161035e9061545f565bd26001600160401b0316816001600160401b0316146111575760405162461bcd60e51b815260040161035e9061530f565b60095462010000900460ff16156111805760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156111a85760405162461bcd60e51b815260040161035e9061538f565b3332146111c75760405162461bcd60e51b815260040161035e9061540f565b600b543410156111e95760405162461bcd60e51b815260040161035e906153bf565b600b5434111561122557600b546040513391340380156108fc02916000818181858888f19350505050158015611223573d6000803e3d6000fd5b505b600b54600d80549091019055600f54d210156112535760405162461bcd60e51b815260040161035e9061552f565b601554d311156112755760405162461bcd60e51b815260040161035e906153ff565b601554d211156112975760405162461bcd60e51b815260040161035e9061534f565b60136040518060e00160405280336001600160a01b03168152602001866001600160401b03168152602001600163ffffffff16815260200160006001600160a01b03168152602001876001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b338686600160138054905003604051611477949392919061513d565b60405180910390a16013546000190192505b505092915050565b60008060008060008060006114a4613e78565b601389815481106114b157fe5b60009182526020918290206040805160e08101825260039390930290910180546001600160a01b038082168086526001600160401b03600160a01b808504821698880189905263ffffffff600160e01b958690048116978901889052600187015494851660608a0181905291850490921660808901819052949093041660a0870181905260029094015460c09096018690529f959e50929c50919a509098509650945092505050565b600a5481565b60105481565b60095460009062010000900460ff16156115925760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156115ba5760405162461bcd60e51b815260040161035e9061538f565b3332146115d95760405162461bcd60e51b815260040161035e9061540f565b600a543410156115fb5760405162461bcd60e51b815260040161035e9061551f565b600a5434111561163757600a546040513391340380156108fc02916000818181858888f19350505050158015611635573d6000803e3d6000fd5b505b600a54600d80549091019055600061164f8333613924565b6011549091506001600160a01b03808316911614156116805760405162461bcd60e51b815260040161035e9061550f565b6001600160a01b038116600090815260126020526040902054600114156116b95760405162461bcd60e51b815260040161035e906153af565b803b806116c557600080fd5b60408051606081019091526001600160a01b038316815260149060208101600381526020016000905281546001810180845560009384526020938490208351920180546001600160a01b0319166001600160a01b0390931692909217808355938301519093829060ff60a01b1916600160a01b83600381111561174457fe5b021790555060408201518154829060ff60a81b1916600160a81b83600381111561176a57fe5b02179055505050506001600160a01b038216600090815260126020526040908190206001905560145490517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a60380868916117c7918591600019019061518f565b60405180910390a150506014546000190190505b919050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118665780601f1061183b57610100808354040283529160200191611866565b820191906000526020600020905b81548152906001019060200180831161184957829003601f168201915b505050505081565b60095460009062010000900460ff161561189a5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156118c25760405162461bcd60e51b815260040161035e9061538f565b3332146118e15760405162461bcd60e51b815260040161035e9061540f565b6001600160a01b0383166000908152601260205260409020546001146119195760405162461bcd60e51b815260040161035e9061532f565b601054826001600160401b031610156119445760405162461bcd60e51b815260040161035e906152ff565b600b543410156119665760405162461bcd60e51b815260040161035e906153bf565b600b543411156119a257600b546040513391340380156108fc02916000818181858888f193505050501580156119a0573d6000803e3d6000fd5b505b600b54600d805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd906119de9033903090879060040161504c565b602060405180830381600087803b1580156119f857600080fd5b505af1158015611a0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a30919081019061436c565b611a4c5760405162461bcd60e51b815260040161035e906154ff565b60136040518060e00160405280336001600160a01b03168152602001846001600160401b03168152602001600263ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc7338484600160138054905003604051611c2c94939291906150c4565b60405180910390a150601354600019015b92915050565b60095462010000900460ff1615611c6c5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff1615611c945760405162461bcd60e51b815260040161035e9061538f565b333214611cb35760405162461bcd60e51b815260040161035e9061540f565b600c54341015611cd55760405162461bcd60e51b815260040161035e906154af565b600c54341115611d1157600c546040513391340380156108fc02916000818181858888f19350505050158015611d0f573d6000803e3d6000fd5b505b600c54600d805490910190556013548110611d3e5760405162461bcd60e51b815260040161035e906154cf565b600060138281548110611d4d57fe5b600091825260209091206003909102018054909150600160e01b900463ffffffff16611dce5780546040517f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff91611dc1916001600160a01b03821691600160a01b90046001600160401b0316908690615220565b60405180910390a1611f05565b8054600160e01b900463ffffffff1660021415611e3c57805460018201546040517f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc792611dc1926001600160a01b0380831693911691600160a01b90046001600160401b0316908790615181565b8054600160e01b900463ffffffff1660031415611e9e578054600182015460028301546040517fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a93611dc1936001600160a01b03918216939116918790615173565b805460018201546040517fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b92611efc926001600160a01b038216926001600160401b03600160a01b928390048116939290920490911690879061522e565b60405180910390a15b5050565b60126020526000908152604090205481565b6003546001600160a01b03163314611f455760405162461bcd60e51b815260040161035e9061542f565b6305f5e100811115611f695760405162461bcd60e51b815260040161035e906154ef565b600b55565b60095460009062010000900460ff1615611f9a5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff1615611fc25760405162461bcd60e51b815260040161035e9061538f565b333214611fe15760405162461bcd60e51b815260040161035e9061540f565b600b543410156120035760405162461bcd60e51b815260040161035e906153bf565b600b54600d805482019055600e54349190910390811080159061202857506015548111155b6120445760405162461bcd60e51b815260040161035e906153cf565b60136040518060e00160405280336001600160a01b03168152602001836001600160401b03168152602001600063ffffffff16815260200160006001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff338260016013805490500360405161222393929190615122565b60405180910390a15050601354600019015b90565b600c5481565b600030828015801561224f57600080fd5b50806001603f1b1115801561226357600080fd5b5080620f42401015801561227657600080fd5b50d192915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118665780601f1061183b57610100808354040283529160200191611866565b6003546001600160a01b031633146123025760405162461bcd60e51b815260040161035e9061542f565b60098054911515620100000262ff000019909216919091179055565b600b5481565b6011546001600160a01b031681565b6003546001600160a01b0316331461235d5760405162461bcd60e51b815260040161035e9061542f565b6009805460ff1916911515919091179055565b600d5481565b60009081526008602090815260408083209383529290522060010154600160401b900460ff1690565b6003546001600160a01b031633146123c95760405162461bcd60e51b815260040161035e9061542f565b6001600160a01b0381166000908152600560205260409020546123fe5760405162461bcd60e51b815260040161035e906152ef565b6001600160a01b03166000818152600560208181526040808420805485526006835290842080546001600160a01b031916905593835252905560048054600019019055565b60095462010000900460ff161561246c5760405162461bcd60e51b815260040161035e906153ef565b336000908152600560205260409020546124985760405162461bcd60e51b815260040161035e9061539f565b600454825111156124bb5760405162461bcd60e51b815260040161035e9061535f565b6000868686866040516020016124d49493929190614fac565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff161561251c57506125d5565b600061252a828686866136cc565b905080156125d2576040516323b872dd60e01b81526001600160a01b038816906323b872dd906125629030908c908b90600401615074565b600060405180830381600087803b15801561257c57600080fd5b505af1158015612590573d6000803e3d6000fd5b505050507f709667d6c56243d41cfff52bd522879fc4e6a83ec590cb83d375956e8abd2064888888886040516125c99493929190615173565b60405180910390a15b50505b505050505050565b6006602052600090815260409020546001600160a01b031681565b600954610100900460ff1681565b60095462010000900460ff161561262f5760405162461bcd60e51b815260040161035e906153ef565b3360009081526005602052604090205461265b5760405162461bcd60e51b815260040161035e9061539f565b6004548251111561267e5760405162461bcd60e51b815260040161035e9061533f565b6000868686866040516020016126979493929190614fac565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156126df57506125d5565b60006126ed828686866136cc565b905080156125d25760405163a9059cbb60e01b81526001600160a01b0388169063a9059cbb90612723908b908a9060040161518f565b602060405180830381600087803b15801561273d57600080fd5b505af1158015612751573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612775919081019061436c565b507f737af5f07a43576924ecf3d94bf486a3af309706430ade370f26198a89164b3f888888886040516125c99493929190615173565b60045481565b6003546001600160a01b031681565b600e5481565b60095462010000900460ff16156127ef5760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff16156128175760405162461bcd60e51b815260040161035e9061538f565b3332146128365760405162461bcd60e51b815260040161035e9061540f565b600c543410156128585760405162461bcd60e51b815260040161035e906154af565b600c5434111561289457600c546040513391340380156108fc02916000818181858888f19350505050158015612892573d6000803e3d6000fd5b505b600c54600d8054909101905560145481106128c15760405162461bcd60e51b815260040161035e906154df565b6000601482815481106128d057fe5b6000918252602082200191508154600160a81b900460ff1660038111156128f357fe5b146129105760405162461bcd60e51b815260040161035e906154bf565b60028154600160a01b900460ff16600381111561292957fe5b141561296d5780546040517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd91611dc1916001600160a01b0390911690859061518f565b80546040517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a6038086891611efc916001600160a01b0390911690859061518f565b600f5481565b6003546001600160a01b031633146129db5760405162461bcd60e51b815260040161035e9061542f565b633b9aca008111156129ff5760405162461bcd60e51b815260040161035e9061536f565b600a55565b60095460009062010000900460ff1615612a305760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff1615612a585760405162461bcd60e51b815260040161035e9061538f565b333214612a775760405162461bcd60e51b815260040161035e9061540f565b600a54341015612a995760405162461bcd60e51b815260040161035e9061547f565b600a54341115612ad557600a546040513391340380156108fc02916000818181858888f19350505050158015612ad3573d6000803e3d6000fd5b505b600a54600d805490910190556000612aed8333613924565b6011549091506001600160a01b0380831691161415612b1e5760405162461bcd60e51b815260040161035e9061550f565b6001600160a01b03811660009081526012602052604090205460011415612b575760405162461bcd60e51b815260040161035e9061531f565b803b80612b6357600080fd5b604080516060810182526001600160a01b038481168252600260208301908152600093830184905260148054600181018083559190955283517fce6d7b5282bd9a3661ae061feed1dbda4e52ab073b1f9285be6e155d9c38d4ec90950180546001600160a01b0319169590931694909417808355905190829060ff60a01b1916600160a01b836003811115612bf457fe5b021790555060408201518154829060ff60a81b1916600160a81b836003811115612c1a57fe5b02179055505050506001600160a01b038216600090815260126020526040908190206001905560145490517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd916117c7918591600019019061518f565b6002546001600160a01b031681565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612d115780601f10612ce657610100808354040283529160200191612d11565b820191906000526020600020905b815481529060010190602001808311612cf457829003601f168201915b5050505050905090565b6001600160a01b0316600090815260056020526040902054151590565b6003546001600160a01b03163314612d625760405162461bcd60e51b815260040161035e9061542f565b6305f5e100811115612d865760405162461bcd60e51b815260040161035e906154ef565b600c55565b6003546001600160a01b03163314612db55760405162461bcd60e51b815260040161035e9061542f565b600980549115156101000261ff0019909216919091179055565b303190565b60056020526000908152604090205481565b6003546001600160a01b03163314612e105760405162461bcd60e51b815260040161035e9061542f565b601055565b6003546001600160a01b03163314612e3f5760405162461bcd60e51b815260040161035e9061542f565b6001600160a01b038116612e655760405162461bcd60e51b815260040161035e9061546f565b6001600160a01b03811660009081526005602052604090205415612e9b5760405162461bcd60e51b815260040161035e9061544f565b61010060045410612ebe5760405162461bcd60e51b815260040161035e9061549f565b60015b6101008111612ef3576000818152600660205260409020546001600160a01b0316612eeb57612ef3565b600101612ec1565b6001600160a01b039091166000818152600560209081526040808320859055938252600690529190912080546001600160a01b0319169091179055600480546001019055565b6040516331a9108f60e11b815260009030906001600160a01b03841690636352211e90612f6a90879060040161553f565b60206040518083038186803b158015612f8257600080fd5b505afa158015612f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612fba9190810190614138565b6001600160a01b0316149392505050565b60095462010000900460ff1615612ff45760405162461bcd60e51b815260040161035e906153ef565b336000908152600560205260409020546130205760405162461bcd60e51b815260040161035e9061539f565b600454825111156130435760405162461bcd60e51b815260040161035e906153df565b60008686868660405160200161305c9493929190614f2d565b60408051808303601f190181529181528151602092830120600087815260088452828120828252909352912060010154909150600160401b900460ff16156130a457506125d5565b60006130b2828686866136cc565b905080156125d2576001600160a01b03881686156108fc028789801580156130d957600080fd5b50806001603f1b111580156130ed57600080fd5b5080620f42401015801561310057600080fd5b50604051600081818185878a8ad0945050505050158015613125573d6000803e3d6000fd5b507fa4c8013c715e65688c1594615ba73e95285332eae47ec97a53f2814e25483c2f338888886040516125c994939291906150ec565b6003546001600160a01b031633146131855760405162461bcd60e51b815260040161035e9061542f565b600e55565b6040516370a0823160e01b81526000906001600160a01b038316906370a08231906131b9908590600401615016565b60206040518083038186803b1580156131d157600080fd5b505afa1580156131e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c3d919081019061442f565b6002546001600160a01b0316156132c4576002546040516000916060916001600160a01b039091169061323f9084903690614fd8565b600060405180830381855af49150503d806000811461327a576040519150601f19603f3d011682016040523d82523d6000602084013e61327f565b606091505b50915091507f8d47f8674d94f113f1cc97d30d1540c9ad6eeb7e7deacf67b41cc6032e4a57d382826040516132b592919061524a565b60405180910390a150506132f7565b6003546001600160a01b031633146132ee5760405162461bcd60e51b815260040161035e9061542f565b6132f781613950565b50565b60095460009062010000900460ff16156133265760405162461bcd60e51b815260040161035e906153ef565b600954610100900460ff161561334e5760405162461bcd60e51b815260040161035e9061538f565b33321461336d5760405162461bcd60e51b815260040161035e9061540f565b6001600160a01b0383166000908152601260205260409020546001146133a55760405162461bcd60e51b815260040161035e9061532f565b600b543410156133c75760405162461bcd60e51b815260040161035e906153bf565b600b5434111561340357600b546040513391340380156108fc02916000818181858888f19350505050158015613401573d6000803e3d6000fd5b505b600b54600d805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd9061343f90339030908790600401615024565b600060405180830381600087803b15801561345957600080fd5b505af115801561346d573d6000803e3d6000fd5b5050505060136040518060e00160405280336001600160a01b0316815260200160006001600160401b03168152602001600363ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff168152602001848152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a338484600160138054905003604051611c2c949392919061508f565b6003546001600160a01b0316331461367b5760405162461bcd60e51b815260040161035e9061542f565b600f55565b60095460ff1681565b336000908152600560205260409020546136b55760405162461bcd60e51b815260040161035e9061539f565b6136be816139bf565b156132f7576132f781613a8f565b600081518351146136ef5760405162461bcd60e51b815260040161035e9061541f565b60095460ff16156137e8576000805b84518110156137d35760006005600086848151811061371957fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020549050806000141561378157600085838151811061375b57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050506137cb565b600160001982011b83811661379957928317926137c8565b60008684815181106137a757fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b50505b6001016136fe565b506137e086868686613c61565b91505061391c565b6000848152600860209081526040808320888452909152812080546001820154919290916001600160401b0316905b865181101561389657600061384888838151811061383157fe5b60200260200101518b613d5c90919063ffffffff16565b6001600160a01b0381166000908152600560205260409020549091508061387057505061388e565b600160001982011b85811661388a57948517946001909401935b5050505b600101613817565b5081835560018301805467ffffffffffffffff19166001600160401b0383161790819055600160401b900460ff161580156138f057506003600454600202816138db57fe5b60018501549190046001600160401b03909116115b156139145750506001908101805460ff60401b1916600160401b179055905061391c565b600093505050505b949350505050565b6000606061393183613dde565b9050606061393f8583613e02565b805160209091012095945050505050565b6001600160a01b03811661396357600080fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600760209081526040808320805433855260059093529083205490919060016000199091011b808216613a845781811783556001808401805467ffffffffffffffff1981166001600160401b03918216909301169190911790819055600160401b900460ff16158015613a605750600360045460020281613a4b57fe5b60018501549190046001600160401b03909116115b15613a845750506001908101805460ff60401b1916600160401b17905590506117db565b506000949350505050565b60606001600160a01b038216613b31576000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015613b255780601f10613afa57610100808354040283529160200191613b25565b820191906000526020600020905b815481529060010190602001808311613b0857829003601f168201915b50505050509050613ba9565b816001600160a01b031663a029b0966040518163ffffffff1660e01b815260040160006040518083038186803b158015613b6a57600080fd5b505afa158015613b7e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613ba691908101906143dd565b90505b7f633e5034510a0c7a27c0b9fb0d789cd980e5df67b48f7616e9c262426397847f600182604051613bdb9291906152ca565b60405180910390a16002546040517f5c36dec2c0ed5b0dbd63872444c637e531efe754847dc745234e3a77b5383ffb91613c22916001600160a01b03909116908590615158565b60405180910390a18051613c3d906001906020840190613eb4565b5050600280546001600160a01b0319166001600160a01b0392909216919091179055565b600083815260086020908152604080832087845282528083208151848152909201908190528290600990613c9a9089908890889061526a565b6020604051602081039080840390855afa158015613cbc573d6000803e3d6000fd5b505050602060405103519050613cd181613e35565b60018301805467ffffffffffffffff19166001600160401b03929092169190911790819055600160401b900460ff16158015613d2c5750600360045460020281613d1757fe5b60018401549190046001600160401b03909116115b15613d4f57506001908101805460ff60401b1916600160401b179055905061391c565b5060009695505050505050565b60208101516040820151604183015160009260ff90911691601b831015613d8457601b830192505b60018684848460405160008152602001604052604051613da7949392919061529e565b6020604051602081039080840390855afa158015613dc9573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b604080516001600160a01b0392909216600560a21b18601483015260348201905290565b604051606090613e1e908490604160f81b908590602001614fe5565b604051602081830303815290604052905092915050565b6000815b8015613e515760019190910190600019810116613e39565b50919050565b60408051606081019091526000808252602082019081526020016000905290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613ef557805160ff1916838001178555613f22565b82800160010185558215613f22579182015b82811115613f22578251825591602001919060010190613f07565b50613f2e929150613f32565b5090565b61223591905b80821115613f2e5760008155600101613f38565b8035613f5781615699565b613f60816155d9565b9392505050565b8051613f5781615699565b600082601f830112613f8357600080fd5b8135613f96613f9182615573565b61554d565b91508181835260208401935060208101905083856020840282011115613fbb57600080fd5b60005b83811015613fe75781613fd18882613f4c565b8452506020928301929190910190600101613fbe565b5050505092915050565b600082601f83011261400257600080fd5b8135614010613f9182615573565b81815260209384019390925082018360005b83811015613fe75781358601614038888261406f565b8452506020928301929190910190600101614022565b8035611c3d816156ad565b8051611c3d816156ad565b8035611c3d816156b6565b600082601f83011261408057600080fd5b813561408e613f9182615593565b915080825260208301602083018583830111156140aa57600080fd5b6140b583828461563c565b50505092915050565b600082601f8301126140cf57600080fd5b81516140dd613f9182615593565b915080825260208301602083018583830111156140f957600080fd5b6140b5838284615648565b8051611c3d816156b6565b8035611c3d816156bf565b60006020828403121561412c57600080fd5b600061391c8484613f4c565b60006020828403121561414a57600080fd5b600061391c8484613f67565b60008060008060008060c0878903121561416f57600080fd5b600061417b8989613f4c565b965050602061418c89828a01614064565b955050604061419d89828a01614064565b94505060606141ae89828a01614064565b93505060808701356001600160401b038111156141ca57600080fd5b6141d689828a01613ff1565b92505060a08701356001600160401b038111156141f257600080fd5b6141fe89828a01613f72565b9150509295509295509295565b600080600080600060a0868803121561422357600080fd5b600061422f8888613f4c565b955050602061424088828901614064565b945050604061425188828901614064565b93505060608601356001600160401b0381111561426d57600080fd5b61427988828901613ff1565b92505060808601356001600160401b0381111561429557600080fd5b6142a188828901613f72565b9150509295509295909350565b60008060008060008060c087890312156142c757600080fd5b60006142d38989613f4c565b965050602061418c89828a01613f4c565b600080604083850312156142f757600080fd5b60006143038585613f4c565b925050602061431485828601614064565b9150509250929050565b6000806040838503121561433157600080fd5b600061433d8585613f4c565b92505060206143148582860161410f565b60006020828403121561436057600080fd5b600061391c848461404e565b60006020828403121561437e57600080fd5b600061391c8484614059565b6000806040838503121561439d57600080fd5b60006143038585614064565b6000602082840312156143bb57600080fd5b81356001600160401b038111156143d157600080fd5b61391c8482850161406f565b6000602082840312156143ef57600080fd5b81516001600160401b0381111561440557600080fd5b61391c848285016140be565b60006020828403121561442357600080fd5b600061391c8484614064565b60006020828403121561444157600080fd5b600061391c8484614104565b6000806040838503121561446057600080fd5b600061446c8585614064565b925050602061431485828601613f4c565b6000806040838503121561449057600080fd5b600061433d858561410f565b60006144a883836144dc565b505060200190565b6000613f6083836145ee565b6144c581615620565b82525050565b6144c56144d7826155d9565b615678565b6144c5816155d9565b60006144f0826155cc565b6144fa81856155d0565b9350614505836155ba565b8060005b8381101561453357815161451d888261449c565b9750614528836155ba565b925050600101614509565b509495945050505050565b6000614549826155cc565b61455381856155d0565b935083602082028501614565856155ba565b8060005b8581101561459f578484038952815161458285826144b0565b945061458d836155ba565b60209a909a0199925050600101614569565b5091979650505050505050565b6144c5816155e4565b6144c56145c1826155e9565b612235565b6144c581612235565b60006145db83856117db565b93506145e883858461563c565b50500190565b60006145f9826155cc565b61460381856155d0565b9350614613818560208601615648565b61461c81615689565b9093019392505050565b6000614631826155cc565b61463b81856117db565b935061464b818560208601615648565b9290920192915050565b600081546001811660008114614672576001811461469857611489565b607f600283041661468381876155d0565b60ff1984168152955050602085019250611489565b600282046146a681876155d0565b95506146b1856155c0565b60005b828110156146d0578154888201526001909101906020016146b4565b9096019695505050505050565b60006146ea601a836155d0565b7f746869732061646472657373206973206e6f74206f7261636c65000000000000815260200192915050565b60006147236020836155d0565b7f76616c7565206d757374206265203e3d206465706f7369744d696e5472633230815260200192915050565b600061475c601c836155d0565b7f746f6b656e56616c756520213d206d73672e746f6b656e76616c756500000000815260200192915050565b60006147956013836155d0565b721d1c98cc8c1059191c995cdcc81b585c1c1959606a1b815260200192915050565b60006147c46014836155d0565b733737ba1030b71030b63637bbb2b2103a37b5b2b760611b815260200192915050565b60006147f46026836155d0565b7f7769746864726177205452433230207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b600061483c6020836155d0565b7f6d73672e746f6b656e76616c7565206d757374203c3d2075696e7436344d6178815260200192915050565b60006148756027836155d0565b7f776974686472617720545243373231207369676e73206e756d203e206f7261638152666c6573206e756d60c81b602082015260400192915050565b60006148be6012836155d0565b710d8cae6e640e8d0c2dc406260606040a8a4b60731b815260200192915050565b60006148ec6024836155d0565b7f776974686472617720545258207369676e73206e756d203e206f7261636c6573815263206e756d60e01b602082015260400192915050565b60006149326008836155d0565b67697320706175736560c01b815260200192915050565b6000614956600a836155d0565b696e6f74206f7261636c6560b01b815260200192915050565b600061497c6014836155d0565b731d1c98cdcc8c5059191c995cdcc81b585c1c195960621b815260200192915050565b60006149ac601d836155d0565b7f6d73672e76616c7565206e65656420203e3d206465706f736974466565000000815260200192915050565b60006149e56028836155d0565b7f6d757374206265747765656e206465706f7369744d696e54727820616e6420758152670d2dce86c689ac2f60c31b602082015260400192915050565b6000614a2f6026836155d0565b7f7769746864726177205452433130207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b6000614a776007836155d0565b66069732073746f760cc1b815260200192915050565b6000614a9a601d836155d0565b7f6d73672e746f6b656e6964206d757374203c3d2075696e7436344d6178000000815260200192915050565b6000614ad36012836155d0565b711b9bdd08185b1b1bddc818dbdb9d1c9858dd60721b815260200192915050565b6000614b01602a836155d0565b7f6572726f72207369674c6973742e6c656e677468206f72207369676e4f7261638152690d8cae65cd8cadccee8d60b31b602082015260400192915050565b6000614b4d6013836155d0565b7236b9b39739b2b73232b910109e9037bbb732b960691b815260200192915050565b6000614b7c601b836155d0565b7f6e6f7420616c6c6f772066756e6374696f6e2066616c6c6261636b0000000000815260200192915050565b6000614bb5601e836155d0565b7f74686973206164647265737320697320616c7265616479206f7261636c650000815260200192915050565b6000614bee6016836155d0565b751d1bdad95b925908084f481b5cd9cb9d1bdad95b9a5960521b815260200192915050565b6000614c20601b836155d0565b7f7468697320616464726573732063616e6e6f74206265207a65726f0000000000815260200192915050565b6000614c59601a836155d0565b7f74726332304d617070696e67466565206e6f7420656e6f756768000000000000815260200192915050565b6000614c92601e836155d0565b7f5f73756e546f6b656e41646472657373203d3d20616464726573732830290000815260200192915050565b6000614ccb601c836155d0565b7f63616e6e6f74206d6f7265207468616e20323536206f7261636c657300000000815260200192915050565b6000614d04601b836155d0565b7f6d73672e76616c7565206e65656420203e3d2072657472794665650000000000815260200192915050565b6000614d3d601d836155d0565b7f6d617070696e674d73672e73746174757320213d205355434345535320000000815260200192915050565b6000614d76601f836155d0565b7f6e6f6e6365203e3d20757365724465706f7369744c6973742e6c656e67746800815260200192915050565b6000614daf601f836155d0565b7f6e6f6e6365203e3d20757365724d617070696e674c6973742e6c656e67746800815260200192915050565b6000614de86011836155d0565b700d8cae6e640e8d0c2dc4062606040a8a4b607b1b815260200192915050565b6000614e156018836155d0565b7f5452433230207472616e7366657246726f6d206572726f720000000000000000815260200192915050565b6000614e4e6023836155d0565b7f6d61696e436861696e41646472657373203d3d2073756e546f6b656e4164647281526265737360e81b602082015260400192915050565b6000614e93601b836155d0565b7f7472633732314d617070696e67466565206e6f7420656e6f7567680000000000815260200192915050565b6000614ecc6025836155d0565b7f746f6b656e76616c7565206d757374206265203e3d206465706f7369744d696e815264054726331360dc1b602082015260400192915050565b6144c56145c182612235565b6144c581615631565b6144c58161560e565b6144c58161561a565b6000614f3982876144cb565b601482019150614f498286614f06565b602082019150614f598285614f06565b602082019150614f698284614f06565b50602001949350505050565b6000614f8182866144cb565b601482019150614f918285614f06565b602082019150614fa18284614f06565b506020019392505050565b6000614fb882876144cb565b601482019150614fc882866144cb565b601482019150614f598285614f06565b600061391c8284866145cf565b6000614ff18286614626565b9150614ffd82856145b5565b60018201915061500d8284614626565b95945050505050565b60208101611c3d82846144dc565b6060810161503282866144bc565b61503f60208301856144bc565b61391c60408301846145c6565b6060810161505a82866144bc565b61506760208301856144bc565b61391c6040830184614f12565b6060810161508282866144bc565b61503f60208301856144dc565b6080810161509d82876144bc565b6150aa60208301866144dc565b6150b760408301856145c6565b61500d60608301846145c6565b608081016150d282876144bc565b6150df60208301866144dc565b6150b76040830185614f1b565b608081016150fa82876144bc565b6150aa60208301866145c6565b6060810161511582866144bc565b61503f60208301856145c6565b6060810161513082866144bc565b61503f6020830185614f1b565b6080810161514b82876144bc565b6150df6020830186614f1b565b6040810161516682856144dc565b613f6060208301846144dc565b6080810161509d82876144dc565b608081016150d282876144dc565b6040810161519d82856144dc565b613f6060208301846145c6565b6060810161511582866144dc565b60e081016151c6828a6144dc565b6151d360208301896145c6565b6151e060408301886145c6565b6151ed60608301876144dc565b6151fa60808301866145c6565b61520760a08301856145c6565b61521460c08301846145c6565b98975050505050505050565b6060810161513082866144dc565b6080810161514b82876144dc565b60208101611c3d82846145ac565b6040810161525882856145ac565b818103602083015261391c81846145ee565b6060810161527882866145c6565b818103602083015261528a818561453e565b9050818103604083015261500d81846144e5565b608081016152ac82876145c6565b6150aa6020830186614f24565b60208082528101613f6081846145ee565b604080825281016152db8185614655565b9050818103602083015261391c81846145ee565b60208082528101611c3d816146dd565b60208082528101611c3d81614716565b60208082528101611c3d8161474f565b60208082528101611c3d81614788565b60208082528101611c3d816147b7565b60208082528101611c3d816147e7565b60208082528101611c3d8161482f565b60208082528101611c3d81614868565b60208082528101611c3d816148b1565b60208082528101611c3d816148df565b60208082528101611c3d81614925565b60208082528101611c3d81614949565b60208082528101611c3d8161496f565b60208082528101611c3d8161499f565b60208082528101611c3d816149d8565b60208082528101611c3d81614a22565b60208082528101611c3d81614a6a565b60208082528101611c3d81614a8d565b60208082528101611c3d81614ac6565b60208082528101611c3d81614af4565b60208082528101611c3d81614b40565b60208082528101611c3d81614b6f565b60208082528101611c3d81614ba8565b60208082528101611c3d81614be1565b60208082528101611c3d81614c13565b60208082528101611c3d81614c4c565b60208082528101611c3d81614c85565b60208082528101611c3d81614cbe565b60208082528101611c3d81614cf7565b60208082528101611c3d81614d30565b60208082528101611c3d81614d69565b60208082528101611c3d81614da2565b60208082528101611c3d81614ddb565b60208082528101611c3d81614e08565b60208082528101611c3d81614e41565b60208082528101611c3d81614e86565b60208082528101611c3d81614ebf565b60208101611c3d82846145c6565b6040518181016001600160401b038111828210171561556b57600080fd5b604052919050565b60006001600160401b0382111561558957600080fd5b5060209081020190565b60006001600160401b038211156155a957600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b6000611c3d826155f6565b151590565b6001600160f81b03191690565b6001600160a01b031690565b6001600160a81b031690565b6001600160401b031690565b60ff1690565b6000611c3d826000611c3d826155d9565b6000611c3d8261560e565b82818337506000910152565b60005b8381101561566357818101518382015260200161564b565b83811115615672576000848401525b50505050565b6000611c3d826000611c3d82615693565b601f01601f191690565b60601b90565b6156a281615602565b81146132f757600080fd5b6156a2816155e4565b6156a281612235565b6156a28161560e56fea36474726f6e5820c2853b81470de0dc070f2507befd45f77788ee29b8517f7c9dc76c4c90fd35736c6578706572696d656e74616cf564736f6c637827302e352e392d646576656c6f702e323031392e382e32312b636f6d6d69742e31393035643732660064";
    String abi = "[{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRX\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"stop\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_sunTokenAddress\",\"type\":\"address\"}],\"name\":\"setSunTokenAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getMappingMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"uint64\"},{\"name\":\"tokenValue\",\"type\":\"uint64\"}],\"name\":\"depositTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getDepositMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"mappingFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"initVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"depositTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"mainToSideContractMap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setDepositFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"depositTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"retryFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"trcToken\"}],\"name\":\"getTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"codeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setStop\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"sunTokenAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setMultivalidatesignSwitch\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bonus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"withdrawDone\",\"outputs\":[{\"name\":\"r\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"delOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC721\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"indexOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"pause\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numOracles\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrx\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryMapping\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setMappingFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"logicAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCodeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"isOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setRetryFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setPause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"oracleIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"addOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"hasNFT\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrx\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"getTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"}],\"name\":\"depositTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"multivalidatesignSwitch\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_logicAddress\",\"type\":\"address\"}],\"name\":\"setLogicAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"tokenValue\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"NewOracles\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"result\",\"type\":\"bool\"},{\"indexed\":false,\"name\":\"msg\",\"type\":\"bytes\"}],\"name\":\"DelegateResult\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"LogicAddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldVersion\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"newVersion\",\"type\":\"string\"}],\"name\":\"ChangeVersion\",\"type\":\"event\"}]\n";
    byte[] contractAddress2 = PublicMethed.deployContractForMain(contractName, abi, code, "",
        maxFeeLimit, 0L, 0, 10000,
        "0", 0, null, gateWatOwnerAddressKey,
        gateWatOwnerAddress, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    String parame2 = "\"" + Base58.encode58Check(contractAddress2) + "\"";

    byte[] input5 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame2, false));
    String ownerTrx1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input5,
            1000000000,
            0l, "0", testOracleAddress, testOracle, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoOwnerTrx1 = PublicMethed
        .getTransactionInfoById(ownerTrx1, blockingStubFull);
    Assert.assertEquals(0, infoOwnerTrx1.get().getResultValue());

    byte[] input6 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
    TransactionExtention return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input6, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);

    String ContractResult1 = Hex.toHexString(return2.getConstantResult(0).toByteArray());

    String tmpAddress2 = ContractResult1.substring(24);
    logger.info(tmpAddress2);
    String addressHex2 = "41" + tmpAddress2;
    logger.info("address_hex1: " + addressHex2);
    String addressFinal2 = Base58.encode58Check(ByteArray.fromHexString(addressHex2));
    logger.info("address_final2: " + addressFinal2);

    byte[] sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal2);
    Assert.assertNotNull(sideContractAddress1);
    Assert.assertEquals(Base58.encode58Check(contractAddress2), addressFinal2);

    Assert.assertTrue(PublicMethed
        .sendcoin(depositAddress, 2000000000L, testDepositAddress, testDepositTrx,
            blockingStubFull));
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Account accountMainBefore = PublicMethed.queryAccount(depositAddress, blockingStubFull);
    long accountMainBeforeBalance = accountMainBefore.getBalance();
//    Assert.assertTrue(accountMainBeforeBalance == 2000000000L);
    Account accountSideBefore = PublicMethed.queryAccount(depositAddress, blockingSideStubFull);
    long accountSideBeforeBalance = accountSideBefore.getBalance();
    ByteString address = accountSideBefore.getAddress();
    String accountSideBeforeAddress = Base58.encode58Check(address.toByteArray());
    logger.info("accountSideBeforeAddress:" + accountSideBeforeAddress);
//    Assert.assertEquals("3QJmnh", accountSideBeforeAddress);

    logger.info("accountBeforeBalance:" + accountMainBeforeBalance);
    logger.info("accountSideBeforeBalance:" + accountSideBeforeBalance);

    logger.info("transferTokenContractAddress:" + mainGateWayAddress);
    String methodStr = "depositTRX()";
    byte[] input = Hex.decode(AbiUtil.parseMethod(methodStr, "", false));

    long callValue = 1500000000;
    String txid = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            callValue,
            input,
            maxFeeLimit, 0, "", depositAddress, testKeyFordeposit, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    Optional<TransactionInfo> infoById = PublicMethed
        .getTransactionInfoById(txid, blockingStubFull);
    Assert.assertTrue(infoById.get().getResultValue() == 0);
    long fee = infoById.get().getFee();
    logger.info("fee:" + fee);
    Account accountMainAfter = PublicMethed.queryAccount(depositAddress, blockingStubFull);
    long accountMainAfterBalance = accountMainAfter.getBalance();
    logger.info("accountAfterBalance:" + accountMainAfterBalance);
    Assert.assertEquals(accountMainAfterBalance, accountMainBeforeBalance - fee - 1500000000);
    Account accountSideAfter = PublicMethed.queryAccount(depositAddress, blockingSideStubFull);
    long accountSideAfterBalance = accountSideAfter.getBalance();
    ByteString addressSideAfter = accountSideAfter.getAddress();
    String accountSideAfterAddress = Base58.encode58Check(addressSideAfter.toByteArray());
    logger.info("accountSideAfterAddress:" + accountSideAfterAddress);
    Assert.assertEquals(Base58.encode58Check(depositAddress), accountSideAfterAddress);
//    Assert.assertEquals(1500000000, accountSideAfterBalance);

    logger.info("sideGatewayAddress:" + sideGatewayAddress);
    long withdrawValue = 1;
    String txid1 = PublicMethed
        .withdrawTrx(ChainIdAddress,
            sideGatewayAddress,
            withdrawValue,
            maxFeeLimit, depositAddress, testKeyFordeposit, blockingStubFull, blockingSideStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);
    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    PublicMethed.waitProduceNextBlock(blockingSideStubFull);

    Optional<TransactionInfo> infoById1 = PublicMethed
        .getTransactionInfoById(txid1, blockingSideStubFull);
    Assert.assertTrue(infoById1.get().getResultValue() == 0);
    long fee1 = infoById1.get().getFee();
    logger.info("fee1:" + fee1);
    Account accountSideAfterWithdraw = PublicMethed
        .queryAccount(depositAddress, blockingSideStubFull);
    long accountSideAfterWithdrawBalance = accountSideAfterWithdraw.getBalance();
    ByteString addressAfterWithdraw = accountSideAfterWithdraw.getAddress();
    String addressAfterWithdrawAddress = Base58
        .encode58Check(addressAfterWithdraw.toByteArray());
    logger.info("addressAfterWithdrawAddress:" + addressAfterWithdrawAddress);
    Assert.assertEquals(Base58.encode58Check(depositAddress), addressAfterWithdrawAddress);
    Assert.assertEquals(accountSideAfterBalance - fee1 - withdrawValue,
        accountSideAfterWithdrawBalance);
    Account accountMainAfterWithdraw = PublicMethed.queryAccount(depositAddress, blockingStubFull);
    long accountMainAfterWithdrawBalance = accountMainAfterWithdraw.getBalance();
    logger.info("accountAfterWithdrawBalance:" + accountMainAfterWithdrawBalance);
    Assert.assertEquals(accountMainAfterWithdrawBalance,
        accountMainAfterBalance + 2 * withdrawValue);

  }


  /**
   * constructor.
   */
  @Test(enabled = true, description = "numOracles in mainChain")
  public void test1DelegateCallMain005() {

    String methodStr1 = "numOracles()";
    byte[] input1 = Hex.decode(AbiUtil.parseMethod(methodStr1, "", false));

    TransactionExtention return1 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Long numOracles = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return1.getConstantResult(0).toByteArray())));
    Assert.assertTrue(1L == Long.valueOf(numOracles));

//not exist account trigger numOracles
    ECKey ecKey = new ECKey(Utils.getRandom());
    byte[] testAddress = ecKey.getAddress();
    String testKeyFortest = ByteArray.toHexString(ecKey.getPrivKeyBytes());

    return1 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1, 1000000000,
            0l, "0", testAddress, testKeyFortest, blockingStubFull);
    numOracles = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return1.getConstantResult(0).toByteArray())));
    Assert.assertTrue(1L == Long.valueOf(numOracles));

    String methodStr2 = "isOracle(address)";
    String parame2 = "\"" + Base58.encode58Check(testOracleAddress) + "\"";

    byte[] input2 = Hex.decode(AbiUtil.parseMethod(methodStr2, parame2, false));

    TransactionExtention return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input2, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Long isOracle = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return2.getConstantResult(0).toByteArray())));
    Assert.assertTrue(1L == Long.valueOf(isOracle));

    //not exist account trigger isOracle(address)
    return2 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input2, 1000000000,
            0l, "0", testAddress, testKeyFortest, blockingStubFull);
    isOracle = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return2.getConstantResult(0).toByteArray())));
    Assert.assertTrue(1L == Long.valueOf(isOracle));

    // is not Oracle address
    String parame3 = "\"" + Base58.encode58Check(mainGateWayAddressKey) + "\"";
    byte[] input3 = Hex.decode(AbiUtil.parseMethod(methodStr2, parame3, false));

    TransactionExtention return3 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input3, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Long isOracle1 = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return3.getConstantResult(0).toByteArray())));
    Assert.assertTrue(0L == Long.valueOf(isOracle1));

    // is not legal address
    String parame4 = "\"" + "T11dff" + "\"";
    byte[] input4 = Hex.decode(AbiUtil.parseMethod(methodStr2, parame4, false));

    TransactionExtention return4 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input4, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    Long isOracle2 = ByteArray.toLong(ByteArray
        .fromHexString(Hex.toHexString(return4.getConstantResult(0).toByteArray())));
    Assert.assertTrue(0L == Long.valueOf(isOracle2));


  }


  /**
   * constructor.
   */
  @Test(enabled = true, description = "transferOwnership in mainChain")
  public void test1DelegateCallMain006() {
    ECKey ecKey = new ECKey(Utils.getRandom());
    byte[] testAddress = ecKey.getAddress();
    String testKeyFortest = ByteArray.toHexString(ecKey.getPrivKeyBytes());
    PublicMethed.printAddress(testKeyFortest);

    Assert.assertTrue(PublicMethed
        .sendcoin(testAddress, 5000000000L, testDepositAddress, testDepositTrx,
            blockingStubFull));
//    String parame1 = "\"" + Base58.encode58Check(testAddress) + "\"";
//
//    //set owner
//    String methodStr1 = "transferOwnership(address)";
//    byte[] input1 = Hex.decode(AbiUtil.parseMethod(methodStr1, parame1, false));
//
//    String txid1 = PublicMethed
//        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
//            0,
//            input1,
//            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    Optional<TransactionInfo> infoById1 = PublicMethed
//        .getTransactionInfoById(txid1, blockingStubFull);
//
//    Assert.assertEquals(0, infoById1.get().getResultValue());
//
//    //use old gateWayOwner setDepositMinTrx
//    String methodStr2 = "setDepositMinTrx(uint256)";
//    String parame2 = "100";
//    byte[] input2 = Hex.decode(AbiUtil.parseMethod(methodStr2, parame2, false));
//
//    String txid2 = PublicMethed
//        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
//            0,
//            input2,
//            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    Optional<TransactionInfo> infoById2 = PublicMethed
//        .getTransactionInfoById(txid2, blockingStubFull);
//
//    Assert.assertEquals(1, infoById2.get().getResultValue());
//
//    //use new gateWayOwner setDepositMinTrx
//    txid2 = PublicMethed
//        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
//            0,
//            input2,
//            maxFeeLimit, 0, "", testAddress, testKeyFortest, blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    infoById2 = PublicMethed
//        .getTransactionInfoById(txid2, blockingStubFull);
//
//    Assert.assertEquals(0, infoById2.get().getResultValue());
//
//    //get DepositMinTrx
//
//    String methodStr3 = "depositMinTrx()";
//    byte[] input3 = Hex.decode(AbiUtil.parseMethod(methodStr3, "", false));
//
//    TransactionExtention return1 = PublicMethed
//        .triggerContractForTransactionExtention(
//            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input3, 1000000000,
//            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
//    Long MinTrx = ByteArray.toLong(ByteArray
//        .fromHexString(Hex.toHexString(return1.getConstantResult(0).toByteArray())));
//    Assert.assertEquals(MinTrx, Long.valueOf(parame2));
//
//    //reset gateWayOwner
//
//    parame1 = "\"" + Base58.encode58Check(gateWatOwnerAddress) + "\"";
//
//    input1 = Hex.decode(AbiUtil.parseMethod(methodStr1, parame1, false));
//
//    txid1 = PublicMethed
//        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
//            0,
//            input1,
//            maxFeeLimit, 0, "", testAddress, testKeyFortest, blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    infoById1 = PublicMethed
//        .getTransactionInfoById(txid1, blockingStubFull);
//
//    Assert.assertEquals(0, infoById1.get().getResultValue());
//
//    parame1 = "\"" + "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb" + "\"";
//
//    input1 = Hex.decode(AbiUtil.parseMethod(methodStr1, parame1, false));
//
//    txid1 = PublicMethed
//        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
//            0,
//            input1,
//            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    infoById1 = PublicMethed
//        .getTransactionInfoById(txid1, blockingStubFull);
//
//    Assert.assertEquals(1, infoById1.get().getResultValue());

    // deploy testMainContract
    String contractName = "testMainContract";
    String code = "60c0604052600560808190527f312e302e3100000000000000000000000000000000000000000000000000000060a0908152620000409160009190620000bf565b506040805180820190915260058082527f312e302e3100000000000000000000000000000000000000000000000000000060209092019182526200008791600191620000bf565b5060016004819055600f81905560108190556011556001600160401b03601655600380546001600160a01b0319163317905562000164565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200010257805160ff191683800117855562000132565b8280016001018555821562000132579182015b828111156200013257825182559160200191906001019062000115565b506200014092915062000144565b5090565b6200016191905b808211156200014057600081556001016200014b565b90565b61581580620001746000396000f3fe6080604052600436106103505760003560e01c8063826be18e116101c6578063bedb86fb116100f7578063e6a9650811610095578063f73392921161006f578063f733929214610dcf578063f821484314610de2578063fd0ee85614610e1c578063fdcfc3ef14610e4b57610350565b8063e6a9650814610d21578063e7fc18f814610d5b578063f2fde38b14610d9557610350565b8063d779039b116100d1578063d779039b14610c39578063df5dd1a514610c73578063dfd16f1914610cad578063dfe5924514610ce757610350565b8063bedb86fb14610b96578063cd9df8e114610bd0578063d421c49b14610bff57610350565b806395a7a4a5116101645780639c1fcc4c1161013e5780639c1fcc4c14610ac4578063a029b09614610af3578063a97e5c9314610b22578063bc3d4d1614610b5c57610350565b806395a7a4a514610a4857806399b0322314610a7757806399f4727a14610ab157610350565b8063898de999116101a0578063898de999146109a85780638da5cb5b146109d7578063905a032614610a0657806392cb74b214610a3557610350565b8063826be18e146109055780638456cb591461093f57806385815ac11461096e57610350565b8063490ae210116102a057806367a527931161023e57806375b4d78c1161021857806375b4d78c14610828578063797a8ba3146108575780637dc79375146108915780637f6e0860146108cb57610350565b806367a527931461078357806367bf5903146107b257806373d9cb49146107ee57610350565b80635ce692f21161027a5780635ce692f2146106b15780635e0082c1146106e057806363e602301461071a578063641657cb1461074957610350565b8063490ae210146106405780634b398e991461067a5780635174169e1461068257610350565b806315c785e71161030d57806338d38c97116102e757806338d38c97146105a45780634171a537146105e05780634638c548146105f3578063473c3bd71461060657610350565b806315c785e7146105335780632ce61de91461056257806332caa1181461059157610350565b806304f06385146103c257806307da68f5146103fe5780630a61c59f146104435780630b2341831461047d5780630c73e51f146104c65780630fc7ad42146104e6575b600a5462010000900460ff16156103825760405162461bcd60e51b8152600401610379906154d5565b60405180910390fd5b600a54610100900460ff16156103aa5760405162461bcd60e51b815260040161037990615475565b60405162461bcd60e51b815260040161037990615525565b3480156103ce57600080fd5b50d380156103db57600080fd5b50d280156103e857600080fd5b506103fc6103f73660046142f1565b610e85565b005b34801561040a57600080fd5b50d3801561041757600080fd5b50d2801561042457600080fd5b5061042d610fef565b60405161043a9190615322565b60405180910390f35b34801561044f57600080fd5b50d3801561045c57600080fd5b50d2801561046957600080fd5b506103fc610478366004614200565b610ffe565b34801561048957600080fd5b50d3801561049657600080fd5b50d280156104a357600080fd5b506104b76104b23660046144f7565b611070565b60405161043a93929190615290565b6104d96104d4366004614563565b611139565b60405161043a9190615625565b3480156104f257600080fd5b50d380156104ff57600080fd5b50d2801561050c57600080fd5b5061052061051b3660046144f7565b6114d9565b60405161043a979695949392919061529e565b34801561053f57600080fd5b50d3801561054c57600080fd5b50d2801561055957600080fd5b506104d96115a2565b34801561056e57600080fd5b50d3801561057b57600080fd5b50d2801561058857600080fd5b506104d96115a8565b6104d961059f36600461448f565b6115ae565b3480156105b057600080fd5b50d380156105bd57600080fd5b50d280156105ca57600080fd5b506105d3611828565b60405161043a919061539f565b6104d96105ee366004614404565b6118b6565b6103fc6106013660046144f7565b611c8b565b34801561061257600080fd5b50d3801561061f57600080fd5b50d2801561062c57600080fd5b506104d961063b366004614200565b611f51565b34801561064c57600080fd5b50d3801561065957600080fd5b50d2801561066657600080fd5b506103fc6106753660046144f7565b611f63565b6104d9611fb6565b34801561068e57600080fd5b50d3801561069b57600080fd5b50d280156106a857600080fd5b506104d9612280565b3480156106bd57600080fd5b50d380156106ca57600080fd5b50d280156106d757600080fd5b506104d9612286565b3480156106ec57600080fd5b50d380156106f957600080fd5b50d2801561070657600080fd5b506104d96107153660046144f7565b61228c565b34801561072657600080fd5b50d3801561073357600080fd5b50d2801561074057600080fd5b506105d36122cc565b34801561075557600080fd5b50d3801561076257600080fd5b50d2801561076f57600080fd5b506103fc61077e366004614434565b612326565b34801561078f57600080fd5b50d3801561079c57600080fd5b50d280156107a957600080fd5b506104d9612424565b3480156107be57600080fd5b50d380156107cb57600080fd5b50d280156107d857600080fd5b506107e161242a565b60405161043a91906150fc565b3480156107fa57600080fd5b50d3801561080757600080fd5b50d2801561081457600080fd5b506103fc610823366004614434565b612439565b34801561083457600080fd5b50d3801561084157600080fd5b50d2801561084e57600080fd5b506104d9612476565b34801561086357600080fd5b50d3801561087057600080fd5b50d2801561087d57600080fd5b5061042d61088c366004614470565b61247c565b34801561089d57600080fd5b50d380156108aa57600080fd5b50d280156108b757600080fd5b506103fc6108c6366004614200565b6124a5565b3480156108d757600080fd5b50d380156108e457600080fd5b50d280156108f157600080fd5b506103fc610900366004614394565b61257f565b34801561091157600080fd5b50d3801561091e57600080fd5b50d2801561092b57600080fd5b506107e161093a3660046144f7565b612719565b34801561094b57600080fd5b50d3801561095857600080fd5b50d2801561096557600080fd5b5061042d612734565b34801561097a57600080fd5b50d3801561098757600080fd5b50d2801561099457600080fd5b506103fc6109a3366004614394565b612742565b3480156109b457600080fd5b50d380156109c157600080fd5b50d280156109ce57600080fd5b506104d96128e7565b3480156109e357600080fd5b50d380156109f057600080fd5b50d280156109fd57600080fd5b506107e16128ed565b348015610a1257600080fd5b50d38015610a1f57600080fd5b50d28015610a2c57600080fd5b506104d96128fc565b6103fc610a433660046144f7565b612902565b348015610a5457600080fd5b50d38015610a6157600080fd5b50d28015610a6e57600080fd5b506104d9612ae7565b348015610a8357600080fd5b50d38015610a9057600080fd5b50d28015610a9d57600080fd5b506103fc610aac3660046144f7565b612aed565b6104d9610abf36600461448f565b612b40565b348015610ad057600080fd5b50d38015610add57600080fd5b50d28015610aea57600080fd5b506107e1612db3565b348015610aff57600080fd5b50d38015610b0c57600080fd5b50d28015610b1957600080fd5b506105d3612dc2565b348015610b2e57600080fd5b50d38015610b3b57600080fd5b50d28015610b4857600080fd5b5061042d610b57366004614200565b612e57565b348015610b6857600080fd5b50d38015610b7557600080fd5b50d28015610b8257600080fd5b506103fc610b913660046144f7565b612e74565b348015610ba257600080fd5b50d38015610baf57600080fd5b50d28015610bbc57600080fd5b506103fc610bcb366004614434565b612ec7565b348015610bdc57600080fd5b50d38015610be957600080fd5b50d28015610bf657600080fd5b506104d9612f3f565b348015610c0b57600080fd5b50d38015610c1857600080fd5b50d28015610c2557600080fd5b506104d9610c34366004614200565b612f44565b348015610c4557600080fd5b50d38015610c5257600080fd5b50d28015610c5f57600080fd5b506103fc610c6e3660046144f7565b612f56565b348015610c7f57600080fd5b50d38015610c8c57600080fd5b50d28015610c9957600080fd5b506103fc610ca8366004614200565b612f85565b348015610cb957600080fd5b50d38015610cc657600080fd5b50d28015610cd357600080fd5b5061042d610ce2366004614533565b6130df565b348015610cf357600080fd5b50d38015610d0057600080fd5b50d28015610d0d57600080fd5b506103fc610d1c36600461423c565b613171565b348015610d2d57600080fd5b50d38015610d3a57600080fd5b50d28015610d4757600080fd5b506103fc610d563660046144f7565b613301565b348015610d6757600080fd5b50d38015610d7457600080fd5b50d28015610d8157600080fd5b506104d9610d90366004614200565b613330565b348015610da157600080fd5b50d38015610dae57600080fd5b50d28015610dbb57600080fd5b506103fc610dca366004614200565b6133af565b6104d9610ddd3660046143ca565b6133e2565b348015610dee57600080fd5b50d38015610dfb57600080fd5b50d28015610e0857600080fd5b506103fc610e173660046144f7565b613739565b348015610e2857600080fd5b50d38015610e3557600080fd5b50d28015610e4257600080fd5b5061042d613768565b348015610e5757600080fd5b50d38015610e6457600080fd5b50d28015610e7157600080fd5b506103fc610e80366004614200565b613771565b600a5462010000900460ff1615610eae5760405162461bcd60e51b8152600401610379906154d5565b33600090815260066020526040902054610eda5760405162461bcd60e51b815260040161037990615485565b60055482511115610efd5760405162461bcd60e51b815260040161037990615465565b6000858585604051602001610f149392919061505b565b60408051808303601f190181529181528151602092830120600087815260098452828120828252909352912060010154909150600160401b900460ff1615610f5c5750610fe8565b6000610f6a828686866137b4565b90508015610fe5576040516001600160a01b0388169087156108fc029088906000818181858888f19350505050158015610fa8573d6000803e3d6000fd5b507fee6b364f3c623639ef23c3c101adb53872193b08602d3013e6fec13e5a0a8c85878787604051610fdc939291906151ed565b60405180910390a15b50505b5050505050565b600a5462010000900460ff1681565b6003546001600160a01b031633146110285760405162461bcd60e51b815260040161037990615515565b6001600160a01b03811661104e5760405162461bcd60e51b815260040161037990615575565b601280546001600160a01b0319166001600160a01b0392909216919091179055565b600080600061107d613f3d565b6015858154811061108a57fe5b60009182526020918290206040805160608101909152910180546001600160a01b03811683529192909190830190600160a01b900460ff1660038111156110cd57fe5b60038111156110d857fe5b81528154602090910190600160a81b900460ff1660038111156110f757fe5b600381111561110257fe5b9052508051602082015191925090600381111561111b57fe5b8260400151600381111561112b57fe5b935093509350509193909250565b60008282d36001600160401b0316826001600160401b03161461116e5760405162461bcd60e51b815260040161037990615545565bd26001600160401b0316816001600160401b03161461119f5760405162461bcd60e51b8152600401610379906153f5565b600a5462010000900460ff16156111c85760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff16156111f05760405162461bcd60e51b815260040161037990615475565b33321461120f5760405162461bcd60e51b8152600401610379906154f5565b600c543410156112315760405162461bcd60e51b8152600401610379906154a5565b600c5434111561126d57600c546040513391340380156108fc02916000818181858888f1935050505015801561126b573d6000803e3d6000fd5b505b600c54600e80549091019055601054d2101561129b5760405162461bcd60e51b815260040161037990615615565b601654d311156112bd5760405162461bcd60e51b8152600401610379906154e5565b601654d211156112df5760405162461bcd60e51b815260040161037990615435565b60146040518060e00160405280336001600160a01b03168152602001866001600160401b03168152602001600163ffffffff16815260200160006001600160a01b03168152602001876001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b3386866001601480549050036040516114bf9493929190615223565b60405180910390a16014546000190192505b505092915050565b60008060008060008060006114ec613f5e565b601489815481106114f957fe5b60009182526020918290206040805160e08101825260039390930290910180546001600160a01b038082168086526001600160401b03600160a01b808504821698880189905263ffffffff600160e01b958690048116978901889052600187015494851660608a0181905291850490921660808901819052949093041660a0870181905260029094015460c09096018690529f959e50929c50919a509098509650945092505050565b600b5481565b60115481565b600a5460009062010000900460ff16156115da5760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff16156116025760405162461bcd60e51b815260040161037990615475565b3332146116215760405162461bcd60e51b8152600401610379906154f5565b600b543410156116435760405162461bcd60e51b815260040161037990615605565b600b5434111561167f57600b546040513391340380156108fc02916000818181858888f1935050505015801561167d573d6000803e3d6000fd5b505b600b54600e8054909101905560006116978333613a0c565b6012549091506001600160a01b03808316911614156116c85760405162461bcd60e51b8152600401610379906155f5565b6001600160a01b038116600090815260136020526040902054600114156117015760405162461bcd60e51b815260040161037990615495565b803b8061170d57600080fd5b60408051606081019091526001600160a01b038316815260159060208101600381526020016000905281546001810180845560009384526020938490208351920180546001600160a01b0319166001600160a01b0390931692909217808355938301519093829060ff60a01b1916600160a01b83600381111561178c57fe5b021790555060408201518154829060ff60a81b1916600160a81b8360038111156117b257fe5b02179055505050506001600160a01b038216600090815260136020526040908190206001905560155490517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a603808689161180f9185916000190190615275565b60405180910390a150506015546000190190505b919050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118ae5780601f10611883576101008083540402835291602001916118ae565b820191906000526020600020905b81548152906001019060200180831161189157829003601f168201915b505050505081565b600a5460009062010000900460ff16156118e25760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff161561190a5760405162461bcd60e51b815260040161037990615475565b3332146119295760405162461bcd60e51b8152600401610379906154f5565b6001600160a01b0383166000908152601360205260409020546001146119615760405162461bcd60e51b815260040161037990615415565b601154826001600160401b0316101561198c5760405162461bcd60e51b8152600401610379906153e5565b600c543410156119ae5760405162461bcd60e51b8152600401610379906154a5565b600c543411156119ea57600c546040513391340380156108fc02916000818181858888f193505050501580156119e8573d6000803e3d6000fd5b505b600c54600e805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd90611a2690339030908790600401615132565b602060405180830381600087803b158015611a4057600080fd5b505af1158015611a54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a789190810190614452565b611a945760405162461bcd60e51b8152600401610379906155e5565b60146040518060e00160405280336001600160a01b03168152602001846001600160401b03168152602001600263ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc7338484600160148054905003604051611c7494939291906151aa565b60405180910390a150601454600019015b92915050565b600a5462010000900460ff1615611cb45760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff1615611cdc5760405162461bcd60e51b815260040161037990615475565b333214611cfb5760405162461bcd60e51b8152600401610379906154f5565b600d54341015611d1d5760405162461bcd60e51b815260040161037990615595565b600d54341115611d5957600d546040513391340380156108fc02916000818181858888f19350505050158015611d57573d6000803e3d6000fd5b505b600d54600e805490910190556014548110611d865760405162461bcd60e51b8152600401610379906155b5565b600060148281548110611d9557fe5b600091825260209091206003909102018054909150600160e01b900463ffffffff16611e165780546040517f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff91611e09916001600160a01b03821691600160a01b90046001600160401b0316908690615306565b60405180910390a1611f4d565b8054600160e01b900463ffffffff1660021415611e8457805460018201546040517f5597031b82d6432b2a17b05edab21773aa78af79c70dbfad5848d5f4a918abc792611e09926001600160a01b0380831693911691600160a01b90046001600160401b0316908790615267565b8054600160e01b900463ffffffff1660031415611ee6578054600182015460028301546040517fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a93611e09936001600160a01b03918216939116918790615259565b805460018201546040517fdd10a17c63663ef29d1afe9e1153ac117e67a4b7e2374c2fb33fa63ac2a83f1b92611f44926001600160a01b038216926001600160401b03600160a01b9283900481169392909204909116908790615314565b60405180910390a15b5050565b60136020526000908152604090205481565b6003546001600160a01b03163314611f8d5760405162461bcd60e51b815260040161037990615515565b6305f5e100811115611fb15760405162461bcd60e51b8152600401610379906155d5565b600c55565b600a5460009062010000900460ff1615611fe25760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff161561200a5760405162461bcd60e51b815260040161037990615475565b3332146120295760405162461bcd60e51b8152600401610379906154f5565b600c5434101561204b5760405162461bcd60e51b8152600401610379906154a5565b600c54600e805482019055600f54349190910390811080159061207057506016548111155b61208c5760405162461bcd60e51b8152600401610379906154b5565b60146040518060e00160405280336001600160a01b03168152602001836001600160401b03168152602001600063ffffffff16815260200160006001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff16815260200160008152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507f3d4b09458f33579a990d5ef0b0e21a441445352d5584b100a4ecad938cee0cff338260016014805490500360405161226b93929190615208565b60405180910390a15050601454600019015b90565b600d5481565b60045481565b600030828015801561229d57600080fd5b50806001603f1b111580156122b157600080fd5b5080620f4240101580156122c457600080fd5b50d192915050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156118ae5780601f10611883576101008083540402835291602001916118ae565b6002546001600160a01b0316156123e1576002546040516000916060916001600160a01b039091169061235c90849036906150be565b600060405180830381855af49150503d8060008114612397576040519150601f19603f3d011682016040523d82523d6000602084013e61239c565b606091505b50915091507f8d47f8674d94f113f1cc97d30d1540c9ad6eeb7e7deacf67b41cc6032e4a57d382826040516123d2929190615330565b60405180910390a15050612421565b6003546001600160a01b0316331461240b5760405162461bcd60e51b815260040161037990615515565b600a805462ff0000191662010000831515021790555b50565b600c5481565b6012546001600160a01b031681565b6003546001600160a01b031633146124635760405162461bcd60e51b815260040161037990615515565b600a805460ff1916911515919091179055565b600e5481565b60009081526009602090815260408083209383529290522060010154600160401b900460ff1690565b6002546001600160a01b0316156124db576002546040516000916060916001600160a01b039091169061235c90849036906150be565b6003546001600160a01b031633146125055760405162461bcd60e51b815260040161037990615515565b6001600160a01b03811660009081526006602052604090205461253a5760405162461bcd60e51b8152600401610379906153d5565b6001600160a01b03166000818152600660208181526040808420805485526007835290842080546001600160a01b031916905593835252905560058054600019019055565b600a5462010000900460ff16156125a85760405162461bcd60e51b8152600401610379906154d5565b336000908152600660205260409020546125d45760405162461bcd60e51b815260040161037990615485565b600554825111156125f75760405162461bcd60e51b815260040161037990615445565b6000868686866040516020016126109493929190615092565b60408051808303601f190181529181528151602092830120600087815260098452828120828252909352912060010154909150600160401b900460ff16156126585750612711565b6000612666828686866137b4565b9050801561270e576040516323b872dd60e01b81526001600160a01b038816906323b872dd9061269e9030908c908b9060040161515a565b600060405180830381600087803b1580156126b857600080fd5b505af11580156126cc573d6000803e3d6000fd5b505050507f709667d6c56243d41cfff52bd522879fc4e6a83ec590cb83d375956e8abd2064888888886040516127059493929190615259565b60405180910390a15b50505b505050505050565b6007602052600090815260409020546001600160a01b031681565b600a54610100900460ff1681565b600a5462010000900460ff161561276b5760405162461bcd60e51b8152600401610379906154d5565b336000908152600660205260409020546127975760405162461bcd60e51b815260040161037990615485565b600554825111156127ba5760405162461bcd60e51b815260040161037990615425565b6000868686866040516020016127d39493929190615092565b60408051808303601f190181529181528151602092830120600087815260098452828120828252909352912060010154909150600160401b900460ff161561281b5750612711565b6000612829828686866137b4565b9050801561270e5760405163a9059cbb60e01b81526001600160a01b0388169063a9059cbb9061285f908b908a90600401615275565b602060405180830381600087803b15801561287957600080fd5b505af115801561288d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128b19190810190614452565b507f737af5f07a43576924ecf3d94bf486a3af309706430ade370f26198a89164b3f888888886040516127059493929190615259565b60055481565b6003546001600160a01b031681565b600f5481565b600a5462010000900460ff161561292b5760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff16156129535760405162461bcd60e51b815260040161037990615475565b3332146129725760405162461bcd60e51b8152600401610379906154f5565b600d543410156129945760405162461bcd60e51b815260040161037990615595565b600d543411156129d057600d546040513391340380156108fc02916000818181858888f193505050501580156129ce573d6000803e3d6000fd5b505b600d54600e8054909101905560155481106129fd5760405162461bcd60e51b8152600401610379906155c5565b600060158281548110612a0c57fe5b6000918252602082200191508154600160a81b900460ff166003811115612a2f57fe5b14612a4c5760405162461bcd60e51b8152600401610379906155a5565b60028154600160a01b900460ff166003811115612a6557fe5b1415612aa95780546040517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd91611e09916001600160a01b03909116908590615275565b80546040517fbe993ac12b073b22e85c8ae5b8d1f863e72ac1fc7d5cc9cc97a3985a6038086891611f44916001600160a01b03909116908590615275565b60105481565b6003546001600160a01b03163314612b175760405162461bcd60e51b815260040161037990615515565b633b9aca00811115612b3b5760405162461bcd60e51b815260040161037990615455565b600b55565b600a5460009062010000900460ff1615612b6c5760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff1615612b945760405162461bcd60e51b815260040161037990615475565b333214612bb35760405162461bcd60e51b8152600401610379906154f5565b600b54341015612bd55760405162461bcd60e51b815260040161037990615565565b600b54341115612c1157600b546040513391340380156108fc02916000818181858888f19350505050158015612c0f573d6000803e3d6000fd5b505b600b54600e805490910190556000612c298333613a0c565b6012549091506001600160a01b0380831691161415612c5a5760405162461bcd60e51b8152600401610379906155f5565b6001600160a01b03811660009081526013602052604090205460011415612c935760405162461bcd60e51b815260040161037990615405565b803b80612c9f57600080fd5b604080516060810182526001600160a01b038481168252600260208301908152600093830184905260158054600181018083559190955283517f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47590950180546001600160a01b0319169590931694909417808355905190829060ff60a01b1916600160a01b836003811115612d3057fe5b021790555060408201518154829060ff60a81b1916600160a81b836003811115612d5657fe5b02179055505050506001600160a01b038216600090815260136020526040908190206001905560155490517fc2757e945b24f03d1ce902d589f8c9e9ed42064f1713ecd7286d9f004e86c6cd9161180f9185916000190190615275565b6002546001600160a01b031681565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015612e4d5780601f10612e2257610100808354040283529160200191612e4d565b820191906000526020600020905b815481529060010190602001808311612e3057829003601f168201915b5050505050905090565b6001600160a01b0316600090815260066020526040902054151590565b6003546001600160a01b03163314612e9e5760405162461bcd60e51b815260040161037990615515565b6305f5e100811115612ec25760405162461bcd60e51b8152600401610379906155d5565b600d55565b6002546001600160a01b031615612efd576002546040516000916060916001600160a01b039091169061235c90849036906150be565b6003546001600160a01b03163314612f275760405162461bcd60e51b815260040161037990615515565b600a80548215156101000261ff001990911617905550565b303190565b60066020526000908152604090205481565b6003546001600160a01b03163314612f805760405162461bcd60e51b815260040161037990615515565b601155565b6002546001600160a01b031615612fbb576002546040516000916060916001600160a01b039091169061235c90849036906150be565b6003546001600160a01b03163314612fe55760405162461bcd60e51b815260040161037990615515565b6001600160a01b03811661300b5760405162461bcd60e51b815260040161037990615555565b6001600160a01b038116600090815260066020526040902054156130415760405162461bcd60e51b815260040161037990615535565b610100600554106130645760405162461bcd60e51b815260040161037990615585565b60015b6101008111613099576000818152600760205260409020546001600160a01b031661309157613099565b600101613067565b6001600160a01b0382166000818152600660209081526040808320859055938252600790529190912080546001600160a01b031916909117905560058054600101905550565b6040516331a9108f60e11b815260009030906001600160a01b03841690636352211e90613110908790600401615625565b60206040518083038186803b15801561312857600080fd5b505afa15801561313c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613160919081019061421e565b6001600160a01b0316149392505050565b600a5462010000900460ff161561319a5760405162461bcd60e51b8152600401610379906154d5565b336000908152600660205260409020546131c65760405162461bcd60e51b815260040161037990615485565b600554825111156131e95760405162461bcd60e51b8152600401610379906154c5565b6000868686866040516020016132029493929190615013565b60408051808303601f190181529181528151602092830120600087815260098452828120828252909352912060010154909150600160401b900460ff161561324a5750612711565b6000613258828686866137b4565b9050801561270e576001600160a01b03881686156108fc0287898015801561327f57600080fd5b50806001603f1b1115801561329357600080fd5b5080620f4240101580156132a657600080fd5b50604051600081818185878a8ad09450505050501580156132cb573d6000803e3d6000fd5b507fa4c8013c715e65688c1594615ba73e95285332eae47ec97a53f2814e25483c2f3388888860405161270594939291906151d2565b6003546001600160a01b0316331461332b5760405162461bcd60e51b815260040161037990615515565b600f55565b6040516370a0823160e01b81526000906001600160a01b038316906370a082319061335f9085906004016150fc565b60206040518083038186803b15801561337757600080fd5b505afa15801561338b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c859190810190614515565b6003546001600160a01b031633146133d95760405162461bcd60e51b815260040161037990615515565b61242181613a38565b600a5460009062010000900460ff161561340e5760405162461bcd60e51b8152600401610379906154d5565b600a54610100900460ff16156134365760405162461bcd60e51b815260040161037990615475565b3332146134555760405162461bcd60e51b8152600401610379906154f5565b6001600160a01b03831660009081526013602052604090205460011461348d5760405162461bcd60e51b815260040161037990615415565b600c543410156134af5760405162461bcd60e51b8152600401610379906154a5565b600c543411156134eb57600c546040513391340380156108fc02916000818181858888f193505050501580156134e9573d6000803e3d6000fd5b505b600c54600e805490910190556040516323b872dd60e01b81526001600160a01b038416906323b872dd906135279033903090879060040161510a565b600060405180830381600087803b15801561354157600080fd5b505af1158015613555573d6000803e3d6000fd5b5050505060146040518060e00160405280336001600160a01b0316815260200160006001600160401b03168152602001600363ffffffff168152602001856001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff168152602001848152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a8154816001600160401b0302191690836001600160401b03160217905550604082015181600001601c6101000a81548163ffffffff021916908363ffffffff16021790555060608201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060808201518160010160146101000a8154816001600160401b0302191690836001600160401b0316021790555060a082015181600101601c6101000a81548163ffffffff021916908363ffffffff16021790555060c082015181600201555050507fa5fce688ea5970750335282d77f1281ee4abb240deb7ce9f57378a87a7d3797a338484600160148054905003604051611c749493929190615175565b6003546001600160a01b031633146137635760405162461bcd60e51b815260040161037990615515565b601055565b600a5460ff1681565b3360009081526006602052604090205461379d5760405162461bcd60e51b815260040161037990615485565b6137a681613aa6565b156124215761242181613b76565b600081518351146137d75760405162461bcd60e51b815260040161037990615505565b600a5460ff16156138d0576000805b84518110156138bb5760006006600086848151811061380157fe5b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020549050806000141561386957600085838151811061384357fe5b60200260200101906001600160a01b031690816001600160a01b031681525050506138b3565b600160001982011b83811661388157928317926138b0565b600086848151811061388f57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b50505b6001016137e6565b506138c886868686613d48565b915050613a04565b6000848152600960209081526040808320888452909152812080546001820154919290916001600160401b0316905b865181101561397e57600061393088838151811061391957fe5b60200260200101518b613e4290919063ffffffff16565b6001600160a01b03811660009081526006602052604090205490915080613958575050613976565b600160001982011b85811661397257948517946001909401935b5050505b6001016138ff565b5081835560018301805467ffffffffffffffff19166001600160401b0383161790819055600160401b900460ff161580156139d857506003600554600202816139c357fe5b60018501549190046001600160401b03909116115b156139fc5750506001908101805460ff60401b1916600160401b1790559050613a04565b600093505050505b949350505050565b60006060613a1983613ec4565b90506060613a278583613ee8565b805160209091012095945050505050565b6001600160a01b038116613a4b57600080fd5b7fef0cee5ab0ba082f9e7e2bec12702da8220ed5e3df2a40dfd209f30629dde002600454604051613a7c9190615625565b60405180910390a1600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600860209081526040808320805433855260069093529083205490919060016000199091011b808216613b6b5781811783556001808401805467ffffffffffffffff1981166001600160401b03918216909301169190911790819055600160401b900460ff16158015613b475750600360055460020281613b3257fe5b60018501549190046001600160401b03909116115b15613b6b5750506001908101805460ff60401b1916600160401b1790559050611823565b506000949350505050565b60606001600160a01b038216613c18576000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015613c0c5780601f10613be157610100808354040283529160200191613c0c565b820191906000526020600020905b815481529060010190602001808311613bef57829003601f168201915b50505050509050613c90565b816001600160a01b031663a029b0966040518163ffffffff1660e01b815260040160006040518083038186803b158015613c5157600080fd5b505afa158015613c65573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613c8d91908101906144c3565b90505b7f633e5034510a0c7a27c0b9fb0d789cd980e5df67b48f7616e9c262426397847f600182604051613cc29291906153b0565b60405180910390a16002546040517f5c36dec2c0ed5b0dbd63872444c637e531efe754847dc745234e3a77b5383ffb91613d09916001600160a01b0390911690859061523e565b60405180910390a18051613d24906001906020840190613f9a565b5050600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000838152600960208181526040808420888552825280842081518581529092019081905290918391613d8090899088908890615350565b6020604051602081039080840390855afa158015613da2573d6000803e3d6000fd5b505050602060405103519050613db781613f1b565b60018301805467ffffffffffffffff19166001600160401b03929092169190911790819055600160401b900460ff16158015613e125750600360055460020281613dfd57fe5b60018401549190046001600160401b03909116115b15613e3557506001908101805460ff60401b1916600160401b1790559050613a04565b5060009695505050505050565b60208101516040820151604183015160009260ff90911691601b831015613e6a57601b830192505b60018684848460405160008152602001604052604051613e8d9493929190615384565b6020604051602081039080840390855afa158015613eaf573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b604080516001600160a01b0392909216600560a21b18601483015260348201905290565b604051606090613f04908490604160f81b9085906020016150cb565b604051602081830303815290604052905092915050565b6000815b8015613f375760019190910190600019810116613f1f565b50919050565b60408051606081019091526000808252602082019081526020016000905290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613fdb57805160ff1916838001178555614008565b82800160010185558215614008579182015b82811115614008578251825591602001919060010190613fed565b50614014929150614018565b5090565b61227d91905b80821115614014576000815560010161401e565b803561403d8161577f565b614046816156bf565b9392505050565b805161403d8161577f565b600082601f83011261406957600080fd5b813561407c61407782615659565b615633565b915081818352602084019350602081019050838560208402820111156140a157600080fd5b60005b838110156140cd57816140b78882614032565b84525060209283019291909101906001016140a4565b5050505092915050565b600082601f8301126140e857600080fd5b81356140f661407782615659565b81815260209384019390925082018360005b838110156140cd578135860161411e8882614155565b8452506020928301929190910190600101614108565b8035611c8581615793565b8051611c8581615793565b8035611c858161579c565b600082601f83011261416657600080fd5b813561417461407782615679565b9150808252602083016020830185838301111561419057600080fd5b61419b838284615722565b50505092915050565b600082601f8301126141b557600080fd5b81516141c361407782615679565b915080825260208301602083018583830111156141df57600080fd5b61419b83828461572e565b8051611c858161579c565b8035611c85816157a5565b60006020828403121561421257600080fd5b6000613a048484614032565b60006020828403121561423057600080fd5b6000613a04848461404d565b60008060008060008060c0878903121561425557600080fd5b60006142618989614032565b965050602061427289828a0161414a565b955050604061428389828a0161414a565b945050606061429489828a0161414a565b93505060808701356001600160401b038111156142b057600080fd5b6142bc89828a016140d7565b92505060a08701356001600160401b038111156142d857600080fd5b6142e489828a01614058565b9150509295509295509295565b600080600080600060a0868803121561430957600080fd5b60006143158888614032565b95505060206143268882890161414a565b94505060406143378882890161414a565b93505060608601356001600160401b0381111561435357600080fd5b61435f888289016140d7565b92505060808601356001600160401b0381111561437b57600080fd5b61438788828901614058565b9150509295509295909350565b60008060008060008060c087890312156143ad57600080fd5b60006143b98989614032565b965050602061427289828a01614032565b600080604083850312156143dd57600080fd5b60006143e98585614032565b92505060206143fa8582860161414a565b9150509250929050565b6000806040838503121561441757600080fd5b60006144238585614032565b92505060206143fa858286016141f5565b60006020828403121561444657600080fd5b6000613a048484614134565b60006020828403121561446457600080fd5b6000613a04848461413f565b6000806040838503121561448357600080fd5b60006143e9858561414a565b6000602082840312156144a157600080fd5b81356001600160401b038111156144b757600080fd5b613a0484828501614155565b6000602082840312156144d557600080fd5b81516001600160401b038111156144eb57600080fd5b613a04848285016141a4565b60006020828403121561450957600080fd5b6000613a04848461414a565b60006020828403121561452757600080fd5b6000613a0484846141ea565b6000806040838503121561454657600080fd5b6000614552858561414a565b92505060206143fa85828601614032565b6000806040838503121561457657600080fd5b600061442385856141f5565b600061458e83836145c2565b505060200190565b600061404683836146d4565b6145ab81615706565b82525050565b6145ab6145bd826156bf565b61575e565b6145ab816156bf565b60006145d6826156b2565b6145e081856156b6565b93506145eb836156a0565b8060005b838110156146195781516146038882614582565b975061460e836156a0565b9250506001016145ef565b509495945050505050565b600061462f826156b2565b61463981856156b6565b93508360208202850161464b856156a0565b8060005b8581101561468557848403895281516146688582614596565b9450614673836156a0565b60209a909a019992505060010161464f565b5091979650505050505050565b6145ab816156ca565b6145ab6146a7826156cf565b61227d565b6145ab8161227d565b60006146c18385611823565b93506146ce838584615722565b50500190565b60006146df826156b2565b6146e981856156b6565b93506146f981856020860161572e565b6147028161576f565b9093019392505050565b6000614717826156b2565b6147218185611823565b935061473181856020860161572e565b9290920192915050565b600081546001811660008114614758576001811461477e576114d1565b607f600283041661476981876156b6565b60ff19841681529550506020850192506114d1565b6002820461478c81876156b6565b9550614797856156a6565b60005b828110156147b65781548882015260019091019060200161479a565b9096019695505050505050565b60006147d0601a836156b6565b7f746869732061646472657373206973206e6f74206f7261636c65000000000000815260200192915050565b60006148096020836156b6565b7f76616c7565206d757374206265203e3d206465706f7369744d696e5472633230815260200192915050565b6000614842601c836156b6565b7f746f6b656e56616c756520213d206d73672e746f6b656e76616c756500000000815260200192915050565b600061487b6013836156b6565b721d1c98cc8c1059191c995cdcc81b585c1c1959606a1b815260200192915050565b60006148aa6014836156b6565b733737ba1030b71030b63637bbb2b2103a37b5b2b760611b815260200192915050565b60006148da6026836156b6565b7f7769746864726177205452433230207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b60006149226020836156b6565b7f6d73672e746f6b656e76616c7565206d757374203c3d2075696e7436344d6178815260200192915050565b600061495b6027836156b6565b7f776974686472617720545243373231207369676e73206e756d203e206f7261638152666c6573206e756d60c81b602082015260400192915050565b60006149a46012836156b6565b710d8cae6e640e8d0c2dc406260606040a8a4b60731b815260200192915050565b60006149d26024836156b6565b7f776974686472617720545258207369676e73206e756d203e206f7261636c6573815263206e756d60e01b602082015260400192915050565b6000614a186008836156b6565b67697320706175736560c01b815260200192915050565b6000614a3c600a836156b6565b696e6f74206f7261636c6560b01b815260200192915050565b6000614a626014836156b6565b731d1c98cdcc8c5059191c995cdcc81b585c1c195960621b815260200192915050565b6000614a92601d836156b6565b7f6d73672e76616c7565206e65656420203e3d206465706f736974466565000000815260200192915050565b6000614acb6028836156b6565b7f6d757374206265747765656e206465706f7369744d696e54727820616e6420758152670d2dce86c689ac2f60c31b602082015260400192915050565b6000614b156026836156b6565b7f7769746864726177205452433130207369676e73206e756d203e206f7261636c8152656573206e756d60d01b602082015260400192915050565b6000614b5d6007836156b6565b66069732073746f760cc1b815260200192915050565b6000614b80601d836156b6565b7f6d73672e746f6b656e6964206d757374203c3d2075696e7436344d6178000000815260200192915050565b6000614bb96012836156b6565b711b9bdd08185b1b1bddc818dbdb9d1c9858dd60721b815260200192915050565b6000614be7602a836156b6565b7f6572726f72207369674c6973742e6c656e677468206f72207369676e4f7261638152690d8cae65cd8cadccee8d60b31b602082015260400192915050565b6000614c336013836156b6565b7236b9b39739b2b73232b910109e9037bbb732b960691b815260200192915050565b6000614c62601b836156b6565b7f6e6f7420616c6c6f772066756e6374696f6e2066616c6c6261636b0000000000815260200192915050565b6000614c9b601e836156b6565b7f74686973206164647265737320697320616c7265616479206f7261636c650000815260200192915050565b6000614cd46016836156b6565b751d1bdad95b925908084f481b5cd9cb9d1bdad95b9a5960521b815260200192915050565b6000614d06601b836156b6565b7f7468697320616464726573732063616e6e6f74206265207a65726f0000000000815260200192915050565b6000614d3f601a836156b6565b7f74726332304d617070696e67466565206e6f7420656e6f756768000000000000815260200192915050565b6000614d78601e836156b6565b7f5f73756e546f6b656e41646472657373203d3d20616464726573732830290000815260200192915050565b6000614db1601c836156b6565b7f63616e6e6f74206d6f7265207468616e20323536206f7261636c657300000000815260200192915050565b6000614dea601b836156b6565b7f6d73672e76616c7565206e65656420203e3d2072657472794665650000000000815260200192915050565b6000614e23601d836156b6565b7f6d617070696e674d73672e73746174757320213d205355434345535320000000815260200192915050565b6000614e5c601f836156b6565b7f6e6f6e6365203e3d20757365724465706f7369744c6973742e6c656e67746800815260200192915050565b6000614e95601f836156b6565b7f6e6f6e6365203e3d20757365724d617070696e674c6973742e6c656e67746800815260200192915050565b6000614ece6011836156b6565b700d8cae6e640e8d0c2dc4062606040a8a4b607b1b815260200192915050565b6000614efb6018836156b6565b7f5452433230207472616e7366657246726f6d206572726f720000000000000000815260200192915050565b6000614f346023836156b6565b7f6d61696e436861696e41646472657373203d3d2073756e546f6b656e4164647281526265737360e81b602082015260400192915050565b6000614f79601b836156b6565b7f7472633732314d617070696e67466565206e6f7420656e6f7567680000000000815260200192915050565b6000614fb26025836156b6565b7f746f6b656e76616c7565206d757374206265203e3d206465706f7369744d696e815264054726331360dc1b602082015260400192915050565b6145ab6146a78261227d565b6145ab81615717565b6145ab816156f4565b6145ab81615700565b600061501f82876145b1565b60148201915061502f8286614fec565b60208201915061503f8285614fec565b60208201915061504f8284614fec565b50602001949350505050565b600061506782866145b1565b6014820191506150778285614fec565b6020820191506150878284614fec565b506020019392505050565b600061509e82876145b1565b6014820191506150ae82866145b1565b60148201915061503f8285614fec565b6000613a048284866146b5565b60006150d7828661470c565b91506150e3828561469b565b6001820191506150f3828461470c565b95945050505050565b60208101611c8582846145c2565b6060810161511882866145a2565b61512560208301856145a2565b613a0460408301846146ac565b6060810161514082866145a2565b61514d60208301856145a2565b613a046040830184614ff8565b6060810161516882866145a2565b61512560208301856145c2565b6080810161518382876145a2565b61519060208301866145c2565b61519d60408301856146ac565b6150f360608301846146ac565b608081016151b882876145a2565b6151c560208301866145c2565b61519d6040830185615001565b608081016151e082876145a2565b61519060208301866146ac565b606081016151fb82866145a2565b61512560208301856146ac565b6060810161521682866145a2565b6151256020830185615001565b6080810161523182876145a2565b6151c56020830186615001565b6040810161524c82856145c2565b61404660208301846145c2565b6080810161518382876145c2565b608081016151b882876145c2565b6040810161528382856145c2565b61404660208301846146ac565b606081016151fb82866145c2565b60e081016152ac828a6145c2565b6152b960208301896146ac565b6152c660408301886146ac565b6152d360608301876145c2565b6152e060808301866146ac565b6152ed60a08301856146ac565b6152fa60c08301846146ac565b98975050505050505050565b6060810161521682866145c2565b6080810161523182876145c2565b60208101611c858284614692565b6040810161533e8285614692565b8181036020830152613a0481846146d4565b6060810161535e82866146ac565b81810360208301526153708185614624565b905081810360408301526150f381846145cb565b6080810161539282876146ac565b615190602083018661500a565b6020808252810161404681846146d4565b604080825281016153c1818561473b565b90508181036020830152613a0481846146d4565b60208082528101611c85816147c3565b60208082528101611c85816147fc565b60208082528101611c8581614835565b60208082528101611c858161486e565b60208082528101611c858161489d565b60208082528101611c85816148cd565b60208082528101611c8581614915565b60208082528101611c858161494e565b60208082528101611c8581614997565b60208082528101611c85816149c5565b60208082528101611c8581614a0b565b60208082528101611c8581614a2f565b60208082528101611c8581614a55565b60208082528101611c8581614a85565b60208082528101611c8581614abe565b60208082528101611c8581614b08565b60208082528101611c8581614b50565b60208082528101611c8581614b73565b60208082528101611c8581614bac565b60208082528101611c8581614bda565b60208082528101611c8581614c26565b60208082528101611c8581614c55565b60208082528101611c8581614c8e565b60208082528101611c8581614cc7565b60208082528101611c8581614cf9565b60208082528101611c8581614d32565b60208082528101611c8581614d6b565b60208082528101611c8581614da4565b60208082528101611c8581614ddd565b60208082528101611c8581614e16565b60208082528101611c8581614e4f565b60208082528101611c8581614e88565b60208082528101611c8581614ec1565b60208082528101611c8581614eee565b60208082528101611c8581614f27565b60208082528101611c8581614f6c565b60208082528101611c8581614fa5565b60208101611c8582846146ac565b6040518181016001600160401b038111828210171561565157600080fd5b604052919050565b60006001600160401b0382111561566f57600080fd5b5060209081020190565b60006001600160401b0382111561568f57600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b6000611c85826156dc565b151590565b6001600160f81b03191690565b6001600160a01b031690565b6001600160a81b031690565b6001600160401b031690565b60ff1690565b6000611c85826000611c85826156bf565b6000611c85826156f4565b82818337506000910152565b60005b83811015615749578181015183820152602001615731565b83811115615758576000848401525b50505050565b6000611c85826000611c8582615779565b601f01601f191690565b60601b90565b615788816156e8565b811461242157600080fd5b615788816156ca565b6157888161227d565b615788816156f456fea36474726f6e58209dd5cc022be16783f84c92cae55bca61672c2b35808ee691b63d23d4df31c82e6c6578706572696d656e74616cf564736f6c637827302e352e392d646576656c6f702e323031392e382e32312b636f6d6d69742e31393035643732660064";
    String abi = "[{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRX\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"stop\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_sunTokenAddress\",\"type\":\"address\"}],\"name\":\"setSunTokenAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getMappingMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"uint64\"},{\"name\":\"tokenValue\",\"type\":\"uint64\"}],\"name\":\"depositTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"getDepositMsg\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"address\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"mappingFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"initVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"depositTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"mainToSideContractMap\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setDepositFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"depositTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"retryFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"it\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"tokenId\",\"type\":\"trcToken\"}],\"name\":\"getTRC10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"codeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setStop\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositFee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"sunTokenAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setMultivalidatesignSwitch\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bonus\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"dataHash\",\"type\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"withdrawDone\",\"outputs\":[{\"name\":\"r\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"delOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC721\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"indexOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"pause\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"numOracles\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrx\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"retryMapping\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"depositMinTrc10\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setMappingFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"txId\",\"type\":\"bytes\"}],\"name\":\"mappingTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"logicAddress\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCodeVersion\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"isOracle\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"setRetryFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"setPause\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getTRX\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"oracleIndex\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc20\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oracle\",\"type\":\"address\"}],\"name\":\"addOracle\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"uid\",\"type\":\"uint256\"},{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"hasNFT\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"oracleSigns\",\"type\":\"bytes[]\"},{\"name\":\"signOracles\",\"type\":\"address[]\"}],\"name\":\"withdrawTRC10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrx\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"getTRC20\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\"},{\"name\":\"uid\",\"type\":\"uint256\"}],\"name\":\"depositTRC721\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"minValue\",\"type\":\"uint256\"}],\"name\":\"setDepositMinTrc10\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"multivalidatesignSwitch\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_logicAddress\",\"type\":\"address\"}],\"name\":\"setLogicAddress\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"tokenValue\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint64\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Received\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Mapping\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRXWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenId\",\"type\":\"trcToken\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC10Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC20Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"contractAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"uid\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"TRC721Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"NewOracles\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"it\",\"type\":\"uint256\"}],\"name\":\"ea\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"result\",\"type\":\"bool\"},{\"indexed\":false,\"name\":\"msg\",\"type\":\"bytes\"}],\"name\":\"DelegateResult\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"LogicAddressChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldVersion\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"newVersion\",\"type\":\"string\"}],\"name\":\"ChangeVersion\",\"type\":\"event\"}]\n";
    byte[] contractAddress = PublicMethed.deployContractForMain(contractName, abi, code, "",
        maxFeeLimit, 0L, 0, 10000,
        "0", 0, null, gateWatOwnerAddressKey,
        gateWatOwnerAddress, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    String parame3 = "\"" + Base58.encode58Check(contractAddress) + "\"";

    byte[] input1 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame3, false));
    String ownerTrx1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1,
            1000000000,
            0l, "0", testOracleAddress, testOracle, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);

    Optional<TransactionInfo> infoOwnerTrx1 = PublicMethed
        .getTransactionInfoById(ownerTrx1, blockingStubFull);
    Assert.assertEquals(0, infoOwnerTrx1.get().getResultValue());

    input1 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
    TransactionExtention return1 = PublicMethed
        .triggerContractForTransactionExtention(
            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1, 1000000000,
            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);

    String ContractRestule1 = Hex.toHexString(return1.getConstantResult(0).toByteArray());

    String tmpAddress1 = ContractRestule1.substring(24);
    logger.info(tmpAddress1);
    String addressHex1 = "41" + tmpAddress1;
    logger.info("address_hex1: " + addressHex1);
    String addressFinal1 = Base58.encode58Check(ByteArray.fromHexString(addressHex1));
    logger.info("address_final1: " + addressFinal1);

    byte[] sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal1);
    Assert.assertNotNull(sideContractAddress1);
    Assert.assertEquals(Base58.encode58Check(contractAddress), addressFinal1);

    String parame4 = "\"" + Base58.encode58Check(gateWatOwnerAddress) + "\"";

    String methodStr4 = "transferOwnership(address)";
    byte[] input4 = Hex.decode(AbiUtil.parseMethod(methodStr4, parame4, false));
    String txid1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            0,
            input4,
            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    Optional<TransactionInfo> infoById1 = PublicMethed
        .getTransactionInfoById(txid1, blockingStubFull);

    Assert.assertEquals(0, infoById1.get().getResultValue());

    List<String> retList = PublicMethedForDailybuild
        .getStrings(infoById1.get().getLogList().get(0).getData().toByteArray());
    Long actualSalt = ByteArray.toLong(ByteArray.fromHexString(retList.get(0)));
    Assert.assertTrue(Long.valueOf("1") == actualSalt);

    parame1 = "\"" + Base58.encode58Check(gateWatOwnerAddress) + "\"";

    input1 = Hex.decode(AbiUtil.parseMethod(methodStr4, parame1, false));

    txid1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            0,
            input1,
            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    PublicMethed.waitProduceNextBlock(blockingStubFull);
    infoById1 = PublicMethed
        .getTransactionInfoById(txid1, blockingStubFull);

    Assert.assertEquals(0, infoById1.get().getResultValue());

  }


  /**
   * constructor.
   */
  @AfterClass
  public void shutdown() throws InterruptedException {
//    String parame2 = "\"T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb\"";
//
//    byte[] input1 = Hex.decode(AbiUtil.parseMethod("setLogicAddress(address)", parame2, false));
//    String ownerTrx1 = PublicMethed
//        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1,
//            1000000000,
//            0l, "0", testOracleAddress, testOracle, blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//    PublicMethed.waitProduceNextBlock(blockingStubFull);
//
//    Optional<TransactionInfo> infoOwnerTrx1 = PublicMethed
//        .getTransactionInfoById(ownerTrx1, blockingStubFull);
//    Assert.assertEquals(0, infoOwnerTrx1.get().getResultValue());
//
//    input1 = Hex.decode(AbiUtil.parseMethod("logicAddress()", "", false));
//    TransactionExtention return1 = PublicMethed
//        .triggerContractForTransactionExtention(
//            WalletClient.decodeFromBase58Check(mainGateWayAddress), 0l, input1, 1000000000,
//            0l, "0", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
//
//    String ContractRestule1 = Hex.toHexString(return1.getConstantResult(0).toByteArray());
//
//    String tmpAddress1 = ContractRestule1.substring(24);
//    logger.info(tmpAddress1);
//    String addressHex1 = "41" + tmpAddress1;
//    logger.info("address_hex1: " + addressHex1);
//    String addressFinal1 = Base58.encode58Check(ByteArray.fromHexString(addressHex1));
//    logger.info("address_final1: " + addressFinal1);
//
//    byte[] sideContractAddress1 = WalletClient.decodeFromBase58Check(addressFinal1);
//    Assert.assertNotNull(sideContractAddress1);
//    Assert.assertEquals("T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb", addressFinal1);

    methodStr1 = "setDepositMinTrx(uint256)";
    parame1 = "1";
    byte[] input2 = Hex.decode(AbiUtil.parseMethod(methodStr1, parame1, false));

    String txid1 = PublicMethed
        .triggerContract(WalletClient.decodeFromBase58Check(mainGateWayAddress),
            0,
            input2,
            maxFeeLimit, 0, "", gateWatOwnerAddress, gateWatOwnerAddressKey, blockingStubFull);
    if (channelFull != null) {
      channelFull.shutdown().awaitTermination(5, TimeUnit.SECONDS);
    }
    if (channelFull1 != null) {
      channelFull1.shutdown().awaitTermination(5, TimeUnit.SECONDS);
    }
  }

}
